Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Undocumented Operator Japh

by liverpole (Monsignor)
on Nov 22, 2006 at 12:59 UTC ( [id://585500]=note: print w/replies, xml ) Need Help??


in reply to Re: Undocumented Operator Japh
in thread Undocumented Operator Japh

Nicely done, chargrill, as always++

One of the fun parts of creating the obfuscation was writing the subroutine to "decrement" a word (eg. "Jus"-- => "Jur").

It wasn't clear initially clear how many "increments" I was going to want to make, and if it turned out to be more than a few (as it certainly did), I needed to a subroutine to do it.

This was what I ended up with:

sub decrement_word { my ($pword) = @_; my @vals = map { ord $_ } (split //, $$pword); my $idx = $#vals; while (1) { if ($vals[$idx] != ord('a') and $vals[$idx] != ord('A')) { --$vals[$idx]; last; } if (0 == $idx) { shift @vals; last; } $vals[$idx] += 25; --$idx; } my $word = join '', map { chr } @vals; $$pword = $word; }

It's too bad, I think, that a word "decrement" isn't part of the Perl language, at least for the obfuscatory potential it would provide. ;-)


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Log In?
Username:
Password:

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

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

    No recent polls found