in reply to Re: Re: Re: Re: Attempt to free unreferenced scalar...
in thread Attempt to free unreferenced scalar...
Otherwise a more complex way of doing that:tr/abcd/1234/;
The latter method has the benefit of being able to work with arbitrarily long strings instead of just single characters.my %tr = ( a => 1, b => 2, c => 3, d => 4 ); my $tr_keys = join('\E|\Q', keys %tr); s/(\Q$tr_keys\E)/$tr{$1}/g;
|
|---|