Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
John W. Krahn wrote: Wagner, David --- Senior Programmer Analyst --- WGO wrote: Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) {

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: So, the <> operator shift()s the filenames off the top of @ARGV? That's usefull knowledge. Yes, but it does it before the loop starts! $ perl -le' print for @ARGV; print; while (<>) { print "$ARGV\t$ARGV[0]" if $. == 1; close ARGV if eof } print; print for @

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
John W. Krahn wrote: > Wagner, David --- Senior Programmer Analyst --- WGO wrote: >> Larsen, Errin M HMMA/IT wrote: >> >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> >>> #!/usr/bin/perl >>> >>> use warnings; >>> use strict; >>> >>> my $logdir = '/some/application/logs'; >>> m

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Wagner, David --- Senior Programmer Analyst --- WGO wrote: Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filena

Re: Diamond Operator and Filenames

2005-02-18 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: Hi Perl-Crunchers, Hello, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filename:\n$_" if( /with errors/ ); } Of course, my probl

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: >> Larsen, Errin M HMMA/IT wrote: >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> > > <> > >>> push @ARGV, @logs; >>> while( <> ) { >>> print "$filename:\n$_" if( /with errors/ ); >>> } >>> >>> Of course, my problem is that I'm not filling

RE: Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
> Larsen, Errin M HMMA/IT wrote: > > Hi Perl-Crunchers, > > > > I've got the following code: > > <> > > push @ARGV, @logs; > > while( <> ) { > > print "$filename:\n$_" if( /with errors/ ); > > } > > > > Of course, my problem is that I'm not filling in $filename in that > > print state

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: > Hi Perl-Crunchers, > > I've got the following code: > > #!/usr/bin/perl > > use warnings; > use strict; > > my $logdir = '/some/application/logs'; > my @logs = <$logdir/*>; > > push @ARGV, @logs; > while( <> ) { > print "$filename:\n$_" if( /with errors

Diamond Operator and Filenames

2005-02-18 Thread Larsen, Errin M HMMA/IT
Hi Perl-Crunchers, I've got the following code: #!/usr/bin/perl use warnings; use strict; my $logdir = '/some/application/logs'; my @logs = <$logdir/*>; push @ARGV, @logs; while( <> ) { print "$filename:\n$_" if( /with errors/ ); } Of course, my problem is that I'm not filling in $f