Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Each pair in @japh (I reformatted $q into @japh for convenience) encodes two or three pieces of information. Each number is split as a nibble and a byte. If the nibble in the first number is non-zero then the byte from the second number is an offset into $data to find a two byte hex encoded character. If the nibble was zero then each byte specifies an index into $data to retrieve the two nibbles of the two byte hex encoded character. The first number's byte is the most significant nibble in that value.

The de-obfuscated source

#!/usr/bin/perl -w use strict; my $c = sub {substr shift(), 0, 2 }; my $d = sub {substr shift(), 0, 1 }; my $f = sub { $_[1] ->( $_[0] ) }; my $data = join '', map sprintf( '%02x', $_ & 1 ? $_ : 255 - $_ ), 0 .. 255; my @japh = ( [qw[082 15E]], [qw[258 0B1]], [qw[258 071]], [qw[258 091]], [qw[042 002]], [qw[258 0C2]], [qw[124 028]], [qw[258 0DE]], [qw[258 16F]], [qw[0C2 0F0]], [qw[258 0CA]], [qw[258 051]], [qw[1A0 00A]], [qw[258 015]], [qw[258 134]], [qw[258 1AF]], [qw[0C2 064]], [qw[1A4 1F4]], [qw[0D6 116]], [qw[258 13C]], [qw[258 0C6]], [qw[258 0D6]], [qw[0C2 1EB]], [qw[1F1 1A0]], [qw[258 042]], [qw[1F4 0A0]]); while (my $chr = shift @japh) { my ($l, $r) = map hex(), @$chr; print chr hex ($l >= 501 ? substr($data, $r, 2) : substr($data, $l, 1) . substr($data, $r, 1) ); }

In reply to Re: indirection by diotalevi
in thread indirection by iamcal

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    Domain Nodelet?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others romping around the Monastery: (2)
    As of 2024-07-19 06:42 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found

      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.