Re: while<> was Re: avoid backticking if at all possible - Re: perl awk question

2002-05-21 Thread drieux
On Tuesday, May 21, 2002, at 04:24 , Peter Scott wrote: [..] > This is somewhat religious, of course, and the rest of software development is not a matter of studying the medieval heresy trials and resolving which side of satan your current project is on > and I'm not invalidating your appr

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-21 Thread drieux
On Tuesday, May 21, 2002, at 06:16 , Tor Hildrum wrote: > You can use the $ARGV[X] values directly like above, or you can put them > in > variables. I guess that's what drieux did. Everything passed from the > command line are put into to the @ARGV array. > So, when I write > % ./argv.pl 2 3 ba

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-21 Thread Todd Wade,,,Room 108
Drieux wrote: > foreach my $file (@ARGV) { # for everything we see on the command line > # let us assume it is a file for simplicity > if ( -f $file ) { > open(FH, "$file"); # normally we want to die > print $_ while(); # silly but a one liner > # could have been while() { print $_ ;} > # but tha

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-21 Thread Tor Hildrum
> From: "Taylor Lewick" <[EMAIL PROTECTED]> > Date: Tue, 21 May 2002 08:00:45 -0500 > To: <[EMAIL PROTECTED]> > Subject: avoid backticking if at all possible - Re: perl awk question > > Thanks drieux, I looked over the code you posted, most of it makes sense, but > am still a little confused over

while<> was Re: avoid backticking if at all possible - Re: perl awk question

2002-05-20 Thread drieux
On Monday, May 20, 2002, at 10:43 , Peter Scott wrote: [..] > At 10:25 PM 5/20/02 -0700, drieux wrote: [..] >>> print while <>; >> >> I thought that was a synonym for STDIN? > > Only in certain cases. It iterates over @ARGV; it's special. Look under > "I/O Operators" in perlop. "Well

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-20 Thread Peter Scott
At 10:25 PM 5/20/02 -0700, drieux wrote: >On Monday, May 20, 2002, at 05:48 , Peter Scott wrote: >>At 02:52 PM 5/20/02 -0700, drieux wrote: >[..] >>> open(FH, "$file"); # normally we want to die >>> print $_ while(); # silly but a one liner >[..] >>I missed the e

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-20 Thread drieux
On Monday, May 20, 2002, at 05:48 , Peter Scott wrote: > At 02:52 PM 5/20/02 -0700, drieux wrote: [..] >> open(FH, "$file"); # normally we want to die >> print $_ while(); # silly but a one liner >> [..] > I missed the earlier articles in the thread so may be off

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-20 Thread Peter Scott
At 02:52 PM 5/20/02 -0700, drieux wrote: >What may help the process here is to think 'cat' but in 'perl' > > #!/usr/bin/perl -w > use strict; > > foreach my $file (@ARGV) { # for everything we see on the command > line >