Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Pulling JAPH out of nowhere...

by Grimy (Pilgrim)
on Jun 04, 2011 at 20:48 UTC ( #908146=note: print w/replies, xml ) Need Help??

in reply to Pulling JAPH out of nowhere...


That's a nice one. I like the fact that it uses pretty much all existing pattern elements. It should definitely be added to perlpacktut, its examples aren't unclear enough.

Unless you're making a motto to using nothing else than packs and unpacks, you could replace the 25 outermost packs by map pack.

Replies are listed 'Best First'.
Re^2: Pulling JAPH out of nowhere...
by ambrus (Abbot) on Jun 08, 2011 at 10:32 UTC

    All pattern elements? Does it use all the crazy and redundant ones as well? My favourites are

    $ perl -we 'print unpack "x*(a*\@0X)*(a*@)*", "hello\n";' o lo llo ello hello ello llo lo o $ perl -we 'print unpack(pack("(a*)*", unpack("(a*@[])*", "x./a")), " +J ust anotherr perl hacker\n");' Just another perl hacker $

    Update: see also Just another unpack hacker.

Re^2: Pulling JAPH out of nowhere...
by kejohm (Hermit) on Jun 05, 2011 at 01:00 UTC

    I was considering using map(), but I figured I should only use pack() and unpack() (I could also have used chr() in place of pack('C',...)).

    There were certain templates that I ignored for one reason or another. The 'P' and 'p' templates would probably only produce random data, and the 'w' template is only available on newer versions of Perl. Also, the 'q' and 'Q' only work on 64-bit Perl, and the 'X' template didn't really seem to make much sense in this context.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://908146]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2018-06-19 18:55 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.