CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [BillKSmith] Grepping a file in all the files in an array and storing them in a hash: Edit Log



iphone
User

Oct 27, 2010, 5:26 PM


Views: 7116
Re: [BillKSmith] Grepping a file in all the files in an array and storing them in a hash

Thanks a lot Bill.You guidance is really helpful.


Code
changed 

$Hash_filenames{$plf}=@file_lines;

to

$Hash_filenames{$plf}=\@file_lines;



Code
 
changed
$Hash_filematches{$filename}= grep( /\/\Q$file_name\E#/i, $Hash_filenames{$plf} );

to

@{ $Hash_filematches{ $filename } } = grep( /\/\Q$file_name\E#/i, @{ $Hash_filenames{ $plf } });


I am getting "Use of uninitialized value in hash element at orphan_plf.pl line 40" and line 40 is
@{ $Hash_filematches{ $filename } } = grep( /\/\Q$file_name\E#/i, @{ $Hash_filenames{ $plf } });

and the output is
PRINTING MATCHED HASHES
apps.plf => ARRAY(0x1981c80)
modem.plf => ARRAY(0x1981ca4)


(This post was edited by iphone on Oct 27, 2010, 5:27 PM)


Edit Log:
Post edited by iphone (User) on Oct 27, 2010, 5:27 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives