Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Actually I thought STDOUT of here was quite challenging and educational. Perhaps I made my analysis a bit too tidy. Some of the insights I had into your program were things I really hadn't considered before.

In particular, I was surprised to learn about END blocks executing in reverse order, and I didn't really have a clear idea of how Perl interprets barewords since I usually avoid them. I also didn't realize until after I had posted my analysis that what I referred to as "empty BEGIN; and END; statements" were in fact redeclarations of sub BEGIN and sub END and that's why they didn't show up in the perl -MO=Deparse output.

I'm afraid I have to disagree with you on Code eating code. Your Perl::Tidy suggestion was kind of a tip-off about what you're doing. Tidying does break the code, but...

the tidied version can be fixed as below so that it reads the original source file instead of the tidied source file.

I'm using a C++-style << "operator" to indicate what each line prints.
#!/usr/bin/perl open( eval STDIN, do { (local $_ = $0) =~ s/\.tdy$//; $_ } ); $= = @ARGV = <>; # 16 lines @h = split //, shift; # "#!/usr/bin/perl\n" $- = @ARGV; # 15 lines { local $" = 't'; ( $b = "@{[@h[3,4]]}" ) =~ y~st~ts~; # "ust" } $h = ucfirst join '', @h[ -5 .. -2 ], $"; # "Perl " &39; # "JHV\x9c\x9a\x99V\x89\x90\x95V\x97\x8c\x99\x931" $b = $h[0] . $b . $"; # "Just " print $b; # << "Just " @h = split //, shift; # "open(eval STDIN,\$0);\$==\@ARGV=<> ;\@\n" # 0123456789012345 6789 012 3456789012 3 4 @_ = map { lc } @h[ $= - 3**2, # 16 - 9 == 7 -> a $= % ( $- / 3 ) + 2, # 16 % 5 + 2 == 3 -> n 2**4 - $=, # 16 - 16 == 0 -> o ( 1 x 2 ) x 2, # 11 x 2 -> tt 2, @h - 10, 3**( @h % 3 ) # 2 -> e, -10 -> r, 3 ** (35 % 3) == 9 -> +" " ]; print @_[ 0 .. 3 ], 'h', @_[ 5 .. @ARGV / 2 ], $h, h; # << "another Pe +rl h" $h =~ s/^.//; # "erl " $h =~ s/...$//; # "e" @h = @h[ 0 .. ( ( ( length $ARGV[6] ) - 5 ) / 2 ) ]; # "open(eval STDI +N," &{-14} && print $h[0]; # "abW`\x1aWhS^\x12EF6;\@\x1e" << "a" &14; # "open(eval STDIN," print map lc, @h[ &1 + 6, 6 * 2 + &1 ]; # "qrgp*gxcn\"UVFKP." << "ck" # 012345678 9012345 # ^ ^ print $h, $h[1]; # << "er" print @h[ &{-2} + 1 ]; # "open(eval STDIN," << "," $ARGV[0]; # no-op sub AUTOLOAD { ( ( $a = $AUTOLOAD ) ) =~ s s.*::sss; # extract subroutine name, e.g. "39" for "&39;" $_ = chr( $a + ord $_ ) for @h; # add name as a number to @h $a; # return name, e.g. "39" }

In reply to Re: Code eating code by jdalbec
in thread Code eating code by cog

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (2)
    As of 2014-09-21 03:14 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (166 votes), past polls