in reply to Re: Show count before data output
in thread Show count before data output
Here is what I have:Use of uninitialized value at fet7a.pl line 28. Total Count =
use File::Find; sub fetcher { my($ct, @data) = (0,()); if( $_ =~ /\.html?$/) { my $name = $File::Find::name; open ( F, $name ) or die "$!: $name\n"; while( $line = <F> ) { for $i ($line =~ /stuff/gi ) { push(@data, "$i\n"); # gather the lines $ct++; } } # since there is no requirement the lines need to match # why not local $/ = undef; @data = <F>; close F; } return($ct,\@data); } my ($ct, $data) = find( \&fetcher, "/directoryHere" ); print @$data; print "\n\nTotal Count = $ct\n\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Show count before data output
by Tomte (Priest) on Jun 23, 2003 at 19:53 UTC |