So far, everyone has described the "enlightened" way to do this. As in, they read your question, and came to the conclusion that you asked "how do I do X using Y?" and so they were telling you how to do X using X.

I'll go the other route this time. Let's say I haven't been enlightened (for whatever reason, the thought that these were octal didn't occur to me until it was pointed out, so we're not far from the truth here ;->). I would do the following:

use strict; for my $i (101 .. 200) { my $a = '\\' . $i; my $val = eval qq{"$a"} || $@; print "$i = $val\n"; }
This answers your question on how to get perl to write out all the characters for you. But it does seem a bit funny. So I'd go the next step:
use strict; my %data; for my $i (101 .. 200) { my $a = '\\' . $i; my $val = eval qq{"$a"} || $@; #print "$i = $val\n"; $data{$i} = $val; } use Data::Dumper; $Data::Dumper::Sortkeys = sub { [ sort { $a <=> $b } keys %{+shift} ] }; $Data::Dumper::Useqq = 1; print Dumper(\%data);
Now we're getting somewhere interesting. For example, I see that "199 => "\00199"," appears. And yet, I also see "177 => "\177",". At this point, I'd look up the documentation and, hopefully, find out what this really means, as is described by everyone else.


In reply to Re: Obfuscation or printing words like \160\162\151\156\164 by Tanktalus
in thread Obfuscation or printing words like \160\162\151\156\164 by jbrugger

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.