Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

JAPH does the splits

by Schmunzie (Sexton)
on Apr 12, 2015 at 23:14 UTC ( #1123235=obfuscated: print w/replies, xml ) Need Help??

My first JAPH for years and years. I'm not sure if this is platform-independent. I hope it is.
@z=split(//,BGu6pCozwKzR);@y=qw(zlz hqa zuo reg rqz fpx 72 26 25 53 25 + 06);while(@z){@a=split(shift@z,crypt(shift@y,pop@y));@g=split(pop@z, +$a[1]);print $g[0]}

Replies are listed 'Best First'.
Re: JAPH does the splits
by afoken (Abbot) on Apr 13, 2015 at 10:48 UTC
    I'm not sure if this is platform-independent. I hope it is.

    perlfunc documents that crypt() is just a wrapper around the crypt() function in the C library. That function may be different on different platforms, according to POSIX: "The algorithm is implementation-defined." and "The first two bytes of this string [the salt argument] may be used to perturb the encoding algorithm." (i.e. implementations may choose to ignore the salt). The crypt function may even be not implemented: "The crypt() function shall fail if: ENOSYS The functionality is not supported on this implementation.". According to perlport, Android does not implement crypt(), and on Win32, it depends on how perl was compiled.

    So, unfortunately, this JAPH may not work on all platforms.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      According to perlport, Android does not implement crypt(), and on Win32, it depends on how perl was compiled

      AFAIK, you'd be hard pressed to find a Win32 perl less than 15 years old that doesn't have crypt().
      It's likely still possible to build perl on Windows such that crypt() is not available - but one would have to make a special effort to achieve that.

      Cheers,
      Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://1123235]
Approved by Athanasius
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2017-12-13 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (378 votes). Check out past polls.

    Notices?