Hello,
currently I have a problem with reading a string from command line and using it in a regular expression.
What I exactly want to do is a bit hard to explain what could be the problem that I cannot find anything with the search function here.
I want to read something like
"foo\x32\x33\x34bar" via Term::ReadLine and convert it so as if I had entered directy in the code like
my $foo = "foo\x32\x33\x34bar";
To make it a bit cleared this is what I currently get:
66 6F 6F 5C 78 33 32 5C 78 33 33 5C 78 33 34 62 61 72 | foo\x32\x33\x34bar
But what I want is:
66 6F 6F 32 33 34 62 61 72 | foo234bar
How can I pack/unpack/convert the string to handle this?
Any ideas will be welcomed!
Thanks in advance :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.