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( <> ) {
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 @
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
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
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
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
> 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
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
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