Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: How to use a variable in tr///

by Roy Johnson (Monsignor)
on Apr 08, 2005 at 12:49 UTC ( #446005=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to use a variable in tr///
in thread How to use a variable in tr///

The "why not just eval?" referred to the case of embedding an eval'd tr/// in an s///e, which would be no better. But your cautions are valid. [Update: and addressed here]

Update:
Though for character replacement, I'd build the regex using a character class rather than alternation:

my $table_re = sprintf '[%s]', join '', map quotemeta, keys %table;

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://446005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-09-24 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (193 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!