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

Re: Writing highly obfuscated code in Perl

by Wookie (Beadle)
on Jul 14, 2001 at 03:11 UTC ( #96624=note: print w/ replies, xml ) Need Help??


in reply to Writing highly obfuscated code in Perl

While I admit to being very new to Perl - I find default/pre-defined variables to be a source of constant inspiration. Using $_ $@ $| etc. can really confuse things. Oh yeah - and overuse $_ - superfluously if possible - as an example from my first attempt I submitted today:

$_=_($_);$_+=$_;
(_ is a sub that returns the input++) and now you can use any of the following - all to get 4:
$_+=$_; $_=$_*$_; $_=$_**$_;
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);


Comment on Re: Writing highly obfuscated code in Perl
Select or Download Code
Re: Re: Writing highly obfuscated code in Perl
by strat (Canon) on Feb 27, 2002 at 14:29 UTC
    Use strange delimiters for patternmatches and ee (or at least e)for substitutions, e.g. s?one?$another?gee

    Use ~~ instead of scalar

    (Thanks to Damian Conway for his talk "Extreme Perl" at the Perl-Workshop; the ideas abouve are from him). Use y instead of tr

    and so on and so on...

    perl -le "~~s--*l-e=>y²*(min²*(cme(²=>s)[^\w]))g=>print"

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://96624]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-10-01 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls