I was disappointed to discover that you don't actually use gcc or awk. However, misdirection is a valid tool in obfuscation. ;-)

Anyway here is a breakdown of the code. With reformatting it looks like this:

$_='gcc 92 !$* % "awk in I$: ar& $:a"'; foreach (/(\S)/g) { $;.= substr(unpack("B*",pack(n,unpack("c",$_))),-4); $;.= "\n" if !(++$i%5); } $_=$;; y;0;\40;; y;1;#;; print;

Substituting $str for $; and making some other changes:

$_='gcc 92 !$* % "awk in I$: ar& $:a"'; foreach $char (/\S/g) { # Capturing parens not needed $str.= substr(unpack("B*",pack(n,unpack("c",$char))),-4); $str.= "\n" if !(++$i%5); } $_=$str; tr/0/\40/; tr/1/#/; print $_;

Looking at the main substution in detail for the first character "g":

$str.= substr(unpack("B*",pack(n,unpack("c",$char))),-4); unpack("c",$char) # is the same as ord $char # 103 pack(n, ... # packs 103 as a little-endian int unpack("B*", ... # Packs it as a binary string: 0000000001100111 substr(..., -4) # Get the last 4 chars: 0111

After these substitutions $str looks like this:

01110011001110010010 00010100101001010010 00010111101110011110 10010100101000010010 01100100101000010010

The transliteration could be done in one pass:     tr/01/ #/; Applying the transliterations gives:

### ## ### # # # # # # # # # # #### ### #### # # # # # # # ## # # # # #

I liked the joke about wcc and agk. :-) There is an example of a JAPH that does use an embedded awk (of sorts) here: JAAH

--
John.


In reply to Re: embedded gcc and awk by jmcnamara
in thread embedded gcc and awk by Len

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.