in reply to Re: Process multiple files in a directory
in thread Process multiple files in a directory
G'day Aaron,
I wouldn't recommend showing someone, who's "new to perl", experimental features (without clearly pointing out that they are experimental and why you are using them). I'm not sure what born_Today will make of the follow two lines on stderr:
when is experimental at <script_name> line 10. when is experimental at <script_name> line 11.
This code seems overly complicated:
while(my $line = <$fd>){ for($line){ print when /Total/; # print matching lines $count++ when /failed/; # count matching lines } }
This may have been better:
while (<$fd>) { print if /Total/; # print matching lines $count++ if /failed/; # count matching lines }
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Process multiple files in a directory
by aaron_baugher (Curate) on Jun 28, 2015 at 01:39 UTC |