Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Built

by iamcal (Friar)
on Jun 06, 2001 at 17:25 UTC ( [id://86192]=obfuscated: print w/replies, xml ) Need Help??

Quite a simple one, but based on the idea of getting the character from outside the script.
$_='-K0145-u-!044847a9-i3105-!30610533-!-i04a0-l3141';my@a= split/\s+/,`perl -V`;for((m((..))g)){my@c=split//;if($c[0]eq '-'){$_=ord$c[1];$_=chr$_-1;}else{split//,$a[hex$c[0]];$_= $_[hex$c[1]];}print;}

Replies are listed 'Best First'.
Re: Built
by chipmunk (Parson) on Jun 06, 2001 at 20:15 UTC
    Output with perl5.005_03: Jut aher prl haPke5 When writing a JAPH that depends on input from outside the script, try to make sure that the source provides the same data across systems. Barring that, inform the reader under which versions of perl the JAPH is known to work.

    This JAPH grabs the output from perl -V, which varies, of course, based on the platform, the version of perl, and the configuration options specified when perl was built. And that's the first perl in the path, rather than the perl that's running the JAPH. (Consider using $^X to run the same perl that's running the script.)

      Revised version to work on Activeperl and normal perl:
      ($_)=(`perl -V`=~m((.*)));s+\(.*\)++;my@a=split/\s+/;$_='-K0 1-t-u-!044c4149-i3105-!30310533-!-i0440-l3147';s(\s)[]g;for( (m((..))g)){my@c=split//;if($c[0]eq'-'){$_=ord$c[1];$_=chr$_ -1;}else{split//,$a[hex$c[0]];$_=$_[hex$c[1]];}print;}
      Urgh. I realise that the output of perl -V varies but thought the first line was consistent. It expects the first line to be

      Summary of my perl5 (revision x version x subversion x) configuration

      but on (my) linux it's

      Summary of my perl5 (x patchlevel x subversion x) configuration

      Entirely my fault for not testing cross platform.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://86192]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-06-15 12:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.