in reply to Re: Re: Re: Re: Attempt to free unreferenced scalar...
in thread Attempt to free unreferenced scalar...

If you're dealing with single characters, you can use tr:
tr/abcd/1234/;
Otherwise a more complex way of doing that:
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;
The latter method has the benefit of being able to work with arbitrarily long strings instead of just single characters.