in reply to How to use a variable in tr///
Two points to remember:
- 1. I shouldn't trust so easily in what others say.
- 2. I should frequently practice with my monitor some oneliners with the examples that I learn...
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.
|
---|
In Section
Seekers of Perl Wisdom