*
beeep* Wrong answer, sorry. You are converting \021
to \036 in the endeffect, and that is not what I'd have
expected. Sure, you could change the \040 in the first line
to a \042 to fix that but what if there is a character lower
than \023 in the original string?
So, taking this, it seems that the following might be the
solution:
tr/\017\020\021\022\002-\200/\012\015\040\011\000-\176/;
For with a quick test it seems that tr takes the first
occurence of a character and doesn't care if there is
another one later. Is that right, is that maybe even
documented on it so I can be sure when using it?
--
use signature;
signature(" So long\nAlfie");
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.