Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2016-10-24 06:35 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (303 votes). Check out past polls.