Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: Interpretting character combinations as special characters.

by vitoco (Friar)
on Dec 11, 2009 at 18:27 UTC ( #812417=note: print w/replies, xml ) Need Help??

in reply to Re^2: Interpretting character combinations as special characters.
in thread Interpretting character combinations as special characters.

You are right... I should have begun with a big warning about how evil could eval be.

Fortunately, OP is processing one char at a time, and I couldn't think of a one-byte malicious code. ;-)

BTW, the first solution I though was this:

$text = 'h\te\nl\l\t\(o\)\n'; print "$text\n"; %token = ('\n'=>"\n", '\t'=>"\t" , '\('=>'(', '\)'=>')'); $text =~ s/(\\.)/$token{$1}||$1/ges; print "$text\n";

That will preserve unknown escape codes from text...

Also, thanks to JavaFan, // operator was new to me...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://812417]
[stevieb]: Obviously, Travis CI just won't cut it for these distributions...
[stevieb]: I went on my merry way writing a cross-platform, network-aware system that works across Perlbrew and Berrybrew systems and runs unit tests for Perl dists on all installed versions, with the ability to manage *brew commands themselves
[stevieb]: That worked out exceptionally well, as when I started that project, I hadn't delved into hardware development yet.
[stevieb]: found a issue in MetaCPAN::Client though today for my revdep tests. At least I think it's an issue

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-06-25 23:33 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.