iphone has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Let me try this again.Data in the below grep always is getting saved to @Hash_filematches[0].For example if the below code greps for some "load.c",it saves the data in [0],next time it greps for someother file"common.c",it puts the data in the same [0].How do I make sure that data is not getting overwritten and data gets appended to[1] [2]......
%Hash_filematches=HASH(0x182f664) safety.plf = ARRAY(0xc5a1020) -----[0]= //while () { ........ @{ $Hash_filematches{ $filename } } = grep( /\/\Q$file_name\E#/i, @{ + $Hash_filenames{ $filename } }); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to append data in a hash
by bart (Canon) on Nov 07, 2010 at 17:56 UTC | |
|
Re: How to append data in a hash
by kcott (Archbishop) on Nov 07, 2010 at 17:57 UTC | |
by iphone (Beadle) on Nov 07, 2010 at 18:44 UTC |