in reply to substituting with hash data
$a = "this is a test"; %b = ( is => 'was' ); foreach my $key ( keys %b ) { $a =~ s/$key/$b{$key}/g; } print $a,"\n"; # output: thwas was a test
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
|
|---|