http://www.perlmonks.org?node_id=446114


in reply to How to use a variable in tr///

Two points to remember: Why? This is what I have just tryed...

perl -e"$old='abc';$old = tr/a/z/g;print \"$old \n\";" Bareword found where operator expected at -e line 1, near "tr/a/z/g" syntax error at -e line 1, near "tr/a/z/g" Execution of -e aborted due to compilation errors.

There is no tr///g since every replacement is done on all the characters. So the /g would always be unnecesary. Just try it!

.{\('v')/}   C H E E R   U P !
 _`(___)' ___a_l_b_e_r_t_o_________
Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.