in reply to Grepping for a value in a hash of filenames and printing the matches
Change:
$Hash_filenames{$plf}=@file_lines;
To:
$Hash_filenames{ $plf } = \@file_lines;
And change:
$Hash_filematches{$filename}= grep( /\/\Q$file_name\E#/i, $Hash_filen +ames{$plf} );
To:
@{ $Hash_filematches{ $filename } } = grep /\Q/$file_name\E#/i, @{ $Ha +sh_filenames{ $plf } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Grepping for a value in a hash of filenames and printing the matches
by iphone (Beadle) on Oct 28, 2010 at 00:32 UTC |