Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

A small (for me) JAPH

by c-era (Curate)
on Dec 23, 2000 at 01:51 UTC ( [id://48099]=obfuscated: print w/replies, xml ) Need Help??

I know some of you are going to think that I didn't write this one. After all it is much smaller, doesn't require IE or windows, and just prints out "Just Another Perl Hacker". Nevertheless, I did write this one (I needed a break from writing xs).

Those more experianced in perl should quickly know what I did, the rest of you will have to figure it out (it's a good learning experiance).

($_='Just Another Perl Hacker,' and$ # There's the string :: { join '', /\b\w/g } =$ # This is the magic :: { (split "")[2]^chop })&& # Here's the question print $JAPH;

Replies are listed 'Best First'.
(Ovid) Re: A small (for me) JAPH
by Ovid (Cardinal) on Dec 23, 2000 at 02:21 UTC
    Beautiful! That's a nifty way of putting that together :)

    Warning: Spoiler Hint Follows

    With c-era's permission, I offer the following hint to aspiring obfuperl coders: add the following two line to the end of the JAPH and study the output CAREFULLY:
    use Data::Dumper; print Dumper( \%main:: ); # <- Hmm, what's that?

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: A small (for me) JAPH
by BooK (Curate) on Dec 23, 2000 at 03:45 UTC

    You might want to look at the optimised code with perl -MO=Deparse:

    Spoiler

    print $JAPH if $_ = 'Just Another Perl Hacker,' and $main::{join '', /\b\w/g} = $main::{(split(//, $_, 0))[ +2] ^ chop $_};

    Nice use of symbolic references and ^...

    The xor part reminds me of my own $A++ under constraints.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-10-03 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (42 votes). Check out past polls.

    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.