jesuashok has asked for the wisdom of the Perl Monks concerning the following question:
I want the above method to be simplified by using map or something else But it should be simple ( i,e ) one line. If the key is available in hash then the value should be removed from the list@list = ( one , two , three ); %hash = ( one => 1 , two => 2 , three => 3 ); foreach (@list) { if ( $hash{$_} ) { $_ = '' ; } }
2004-12-08 Janitored by Arunbear - added code tags, as per Monastery guidelines
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Arrays and Hashes Mapping
by pingo (Hermit) on Dec 08, 2004 at 11:15 UTC | |
by kappa (Chaplain) on Dec 08, 2004 at 12:17 UTC |