On Tuesday 01 Mar 2005 01:08, John W. Krahn wrote:
Gavin Henry wrote:
Dear all,
Hello,
How come if I:
perldoc -f setpwent
I don't get the same as shown here:
http://www.perl.com/doc/manual/html/pod/perlfunc/setpwent.html
the perldoc way didn't even say:
setpwent -
Hi All,
I need to run a perl script, which ssh'es to another
box and has to run some code, which is given in the
present script and return some value. Is that
possible? Net::SSH doesnt seem to be the answer as it
merely runs a command at the remote host.
Thanks,
Alok
Dear all,
I remember reading how Randal puts the =1= =2= in front of each line of
code on his site, but I can't find it again.
Anyone remember?
Thanks.
--
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] Just ask!!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
quote who=lohit
is this what you are looking for?
$count=1;
while(INFILE) {
print OUTFILE =$count++= $_;
}
It was more like perl -pi -e blah
On Tue, 1 Mar 2005 11:23:44 - (GMT), Gavin Henry [EMAIL PROTECTED]
wrote:
Dear all,
I remember reading how Randal puts the =1= =2= in front
#!/usr/bin/perl
use strict;
use warnings;
my $file = 'in.txt';
open FH, $file or die qq(Cannot open $file: $!);
my @replacements;
while ( FH ) {
next unless m/\|/;
# limit split to just 2 resulting arguments.
push @replacements, [ split /\|/, $_, 2 ];
}
$file = 'in.blah';
open IN,
This??
perl -i.bak -ne 'print =$.= $_' /path/to/code_file
Manav
-Original Message-
From: Gavin Henry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 5:44 PM
To: beginners@perl.org
Subject: Re: code on stonehenge.com for adding line numbers to code
quote who=lohit
is this
Please bottom post...
Manav Mathur wrote:
This??
perl -i.bak -ne 'print =$.= $_' /path/to/code_file
Manav
I am no golfer, but you don't need the -i and .bak if you are not
editing the file, and I suspect this will make things slower because
Perl has to keep track of whether you are editing. You
Alok Bhatt wrote:
Hi All,
I need to run a perl script, which ssh'es to another
box and has to run some code, which is given in the
present script and return some value. Is that
possible? Net::SSH doesnt seem to be the answer as it
merely runs a command at the remote host.
Thanks,
Alok
Is the
[EMAIL PROTECTED] wrote:
I am running AIX 5.2 with gcc 3.3.2
Can anyone help? I looked for the specific list and could not find it.
Here are my errors after a make with CC pointed to cc_r and
/usr/local/bin/gcc :
(See attached file: out)(See attached file: outwithgcc)
derek
In general the
On Tue, Mar 01, 2005 at 08:51:58AM -0500, Wiggins d'Anconia wrote:
and I figure you can remove the assignment in the
below, but I am not sure how
perl -p -e '$_ = =$.= $_' test.pl
Here's one way.
perl -pe 's/^/=$.= /' test.pl
--
Paul Johnson - [EMAIL
3.5 I use IRC, any helpful Perl channels out there?
Glad you asked! There is indeed a place where you can ask all your Perl
questions on IRC.
Network: irc.rhizomatic.net
Channel: #perl-help
ChatZilla can't connect to irc.rhizomatic.net unknown server...
Is this outdated, or do I
--
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] Just ask!!!
quote who=Paul Johnson
On Tue, Mar 01, 2005 at 08:51:58AM -0500, Wiggins d'Anconia wrote:
and I figure you can remove the assignment in the
below, but I am not sure how
perl -p
perldoc -f unlink
Note: unlink will not delete directories unless you are superuser and
the -U flag is supplied to Perl.
Have you actually done that? Normally, I do go by perldoc but in this case,
Yes, that is where I got the info about removing a directpry which is
what you asked about.
for a
Todd W mailto:[EMAIL PROTECTED] wrote:
Its a lot easier than that. If the WSDL file is good. SOAP::Lite
comes with a program called stubmaker.pl that takes a wsdl file as an
argument and creates a module that you can use(). Then all you do is
call functions the module makes available.
Thank
yeah thats what I thought and the problem is Perl came installed under
/usr/bin by default. Obviously is was compiled by cc_r and currently I am
trying to get a trial version of XLC IBMs AIX C compiler.
thank you,
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
All,
Can someone explain this code line by line?
Obviously I understand most of it but lines 4, 5, 6 and 10 I am fuzzy.
For line 4: if ($query) . if what? Here I would expect to see if ( -s
$query ) or something like a return code/exit code value check like $?
8.
What is if ($query)
Has anyone ever accidentally changed the stdout for perl to nowhere. I can't
print anything to the screen from the command prompt with -
#! /usr/bin/perl-w
use strict;
print Hello world. \n;
exit;
result =
I run perl 5.6 on a windoze machine, this is the first time I've ever seen
this.
I
[EMAIL PROTECTED] wrote:
All,
Can someone explain this code line by line?
Obviously I understand most of it but lines 4, 5, 6 and 10 I am fuzzy.
For line 4: if ($query) . if what? Here I would expect to see if ( -s
If it has a value (IE is not '',0, or undef)
$query ) or something like a
[EMAIL PROTECTED] wrote:
All,
Can someone explain this code line by line?
Obviously I understand most of it but lines 4, 5, 6 and 10 I am fuzzy.
I can try :-).
For line 4: if ($query) . if what? Here I would expect to see if ( -s
$query ) or something like a return code/exit code value check
excellent thank you to JuniperHost and you Wiggens.
So here is what I ended up with:
1 use Net::DNS;
2my $res = Net::DNS::Resolver-new;
3 my $query = $res-query(example.com, NS);
4if ($query != undef) {
5foreach ($query-answer) {
6 if ($_-type eq 'NS' ) {
sorry, i'm a dummy, your script works good, but i've another question:
why your script replace only ONE word per line, even i load the array
with 16 terms (and i note that there are 3 or 4 lines with at least 2
different terms of the list)? i tried to enbed your script in a large
for routine(about
Hello ,
are you trying to print out in a web browser ? ? if so ... then
add the following line before your print line :
print content-type: text/html \n\n;
bye
On Tue, 1 Mar 2005 10:40:53 -0500, Earthlink-m_ryan
[EMAIL PROTECTED] wrote:
Has anyone ever accidentally changed the stdout for
Hello ,
sorry i didn't read it carefully .. well , first
try by removing the exit at the END
check the Error LOGS to see if there's an Error which make the output doesn't
appear on the screen
bye
On Tue, 1 Mar 2005 10:40:53 -0500, Earthlink-m_ryan
[EMAIL PROTECTED] wrote:
Has anyone
Also,
there should be a space between #!/usr/bin/perl and the -w switch.
Manav
-Original Message-
From: bright true [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 10:51 PM
To: Earthlink-m_ryan
Cc: beginners@perl.org
Subject: Re: accidently changed stdout | can't print to screen
On Tue, 1 Mar 2005 09:17:09 -0800, bright true [EMAIL PROTECTED] wrote:
Hello ,
are you trying to print out in a web browser ? ? if so ... then
add the following line before your print line :
print content-type: text/html \n\n;
bye
On Tue, 1 Mar 2005 10:40:53 -0500,
bright true wrote:
Hello ,
sorry i didn't read it carefully .. well , first
try by removing the exit at the END
check the Error LOGS to see if there's an Error which make the output
doesn't
appear on the screen
bye
What Error LOGS are you referring to. I don't get any errors. I can change
my
lohit wrote:
if you think you have changed environment, use a new 'cmd' prompt. you
couldn't have possibly changed system environment variables. the above
code snippent should work .one way is to write new piece of code and
test it out.
I have tested several programs. I have also run a program
Web Solving [EMAIL PROTECTED] wrote:
: sorry, i'm a dummy, your script works good, but i've another
: question: why your script replace only ONE word per line, even
: i load the array with 16 terms (and i note that there are 3 or
: 4 lines with at least 2 different terms of the list)? i tried
:
my @a=();
my $res = Net::DNS::Resolver-new;
my $query = $res-query(.ohnet, NS);
if ( $query != 0 or $query != undef or $query != ' ' ) {
foreach ($query-answer) {
if ( $_-type eq 'NS' ) {
#next unless $_-type eq A;
perlmails wrote:
Can you print this one liner:?
DOSperl -e print 'Hello World'
Yes, I can print with c:perl -e print 'Hello World'
Still can't print from a script. Checked file association that wasn't it.
Thanks for the reply.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
Nevermind I got it!
my @a=();
my $e=0;
my $res = Net::DNS::Resolver-new;
my $query = $res-query(.ohnet, NS);
if ( $query != 0 or $query != undef or $query != ' ' ) {
foreach ($query-answer) {
if ( $_-type eq 'NS' ) {
thinbrowser wrote:
also, try printing in a editor that captures ouput,
and also allows you to submit arguments just like on a command prompt.
Crimson Editor (windoz freeware) does that.
Let us know if anything you try .. works?
Thanks for all the great advice. I was able to track down the
thinbrowser wrote:
also, try printing in a editor that captures ouput,
and also allows you to submit arguments just like on a command prompt.
Crimson Editor (windoz freeware) does that.
Let us know if anything you try .. works?
Thanks for all the great advice. I was able to track down the
Here is some code I've written:
#!/bin/perl -w
use strict;
sub choose_vi {
print Use vi?\n;
print Y/y for yes. Any other key quits: ;
chomp(my $answer = STDIN);
if ($answer =~ /^[yY]$/) {
print Enter line number? (Y for yes):;
chomp(my $answer = STDIN);
Christopher wrote:
Here is some code I've written:
#!/bin/perl -w
use strict;
sub choose_vi {
print Use vi?\n;
print Y/y for yes. Any other key quits: ;
chomp(my $answer = STDIN);
if ($answer =~ /^[yY]$/) {
print Enter line number? (Y for yes):;
chomp(my $answer = STDIN);
print \n;
Thank you all for the reply :)
You might expect some silly, basic questions from me in the near future.
On Mon, 28 Feb 2005 09:45:31 -0500, Jay [EMAIL PROTECTED] wrote:
On Mon, 28 Feb 2005 05:28:40 -0800, Rocky Chett [EMAIL PROTECTED] wrote:
Hi list,
I am a database
Hi Derek
I have two propositions to the code below, which in my opinion will not
function because you still use $rr within the foreach, while you replaced it
by the implicit $_ in the foreach line)
++ Line 4:
if ($query != undef)
can be written as
if (defined $query)
The meaning and the
Try this - the 'g' at the end means 'global', that is, every occurrence of
the target string.
$line =~ s/\Q$replacement-[0]\E/$replacement-[1]/g;
HTH, GStC.
-Original Message-
From: Web Solving [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 11:58 AM
To: Charles K.
Joe,
if you still care, here is my final code. Will you please eval it and them
comment again?
thanks,
my $outfile0 = qq(/home/root/dns_servers.plout);
open (F, +$outfile0) || die could not open file: $outfile0 $!;
my @a=();
my $e=0;
my $res = Net::DNS::Resolver-new;
my
On 3/1/05 9:18 AM, in article [EMAIL PROTECTED],
JupiterHost.Net [EMAIL PROTECTED] wrote:
perldoc -f unlink
Note: unlink will not delete directories unless you are superuser and
the -U flag is supplied to Perl.
Have you actually done that? Normally, I do go by perldoc but in this
Jason Balicki [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Todd W mailto:[EMAIL PROTECTED] wrote:
Its a lot easier than that. If the WSDL file is good. SOAP::Lite
comes with a program called stubmaker.pl that takes a wsdl file as an
argument and creates a module that you can
All,
I'm trying to determine what is wrong with this script. Here is what
I'm trying to do:
1.) Export the output of the following command to a file located at
c:\perl\bin\log\accessreport.log
Global Domain Admins ARFW c:\perl\bin\accessreport.log
2.) For each line of information
Hi Derek
(in my last answer I wrote 'proposition' instead of 'proposal' - not native
english speaking ;-)
Am Dienstag, 1. März 2005 23.06 schrieb [EMAIL PROTECTED]:
Joe,
if you still care, here is my final code. Will you please eval it and them
comment again?
thanks,
(again, I didn't
Hi everyone. I have a question regarding splitting large projects into
multiple files to add at least a little convenience when further
maintenance is needed. Consider this more than trivial example to be a
program of 4000 lines:
print ' ';
my $input = STDIN;
chomp $input;
if ($input =~ /^\d+$/)
Todd W mailto:[EMAIL PROTECTED] wrote:
Its a lot easier than that. If the WSDL file is good. SOAP::Lite
comes with a program called stubmaker.pl that takes a wsdl file as an
argument and creates a module that you can use(). Then all you do is
call functions the module makes available.
Robert wrote:
On 3/1/05 9:18 AM, in article [EMAIL PROTECTED],
JupiterHost.Net [EMAIL PROTECTED] wrote:
perldoc -f unlink
Note: unlink will not delete directories unless you are superuser and
the -U flag is supplied to Perl.
Have you actually done that? Normally, I do go by perldoc but in this
Hi,
I wrote a perl script that will parse a log file and
output it into a text file. I made its filename to end
in .swx so that it will by default open in
openoffice.org. My problem is that, when you open the
file, each line cannot accomodate the default margin
settings of openoffice.org such
I've been learning C++ using cygwin on my Windows PC
and thought it would be handy to have a Perl script
that automated features of g++. The script takes one
to two invocation arguments:
./cedit somefile.C++
./cedit somefile.C++ outputfile
cedit runs g++. After the file is compiled,etc., any
Hi Derek,
hi all (see below, please help)
[...]
my $res = Net::DNS::Resolver-new;
my $query = $res-query(.ohnet, NS);
if ( $query != 0 or $query != undef or $query != ' ' ) {
Please replace this condition by
if ($query)
I'm to confused at the moment to
Hi Harold
You can't just change the suffix of a file to make it readable by an
application as open office. OO is not a text editor dealing with human
readable text; OO stores it's .swx files in a binary format (eventually as
compressed XML, I'm not sure at the moment).
Use a real text editor
My apologies, I have to withdraw the following
You can't just change the suffix of a file to make it readable by an
application as open office. OO is not a text editor dealing with human
readable text; OO stores it's .swx files in a binary format (eventually as
compressed XML, I'm not sure at
Hi all,
May be my earlier mail is missed somewhere.. I wish you all a nice day..
While matching a string with each line of a file, if the string is
matched with any of those lines, How can we get the line number of the
line where it is matched..? Is there any built-in function for fetching
the
On Wed, 2 Mar 2005, Suneel Kumar B wrote:
May be my earlier mail is missed somewhere.. I wish you all a nice day..
While matching a string with each line of a file, if the string is
matched with any of those lines, How can we get the line number of the
line where it is matched..? Is
53 matches
Mail list logo