Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: 2nd in as many days:

by iamcal (Friar)
on Jun 08, 2001 at 11:56 UTC ( [id://86862]=note: print w/replies, xml ) Need Help??


in reply to 2nd in as many days:

nice. a quick breakdown:
# # put some characters in $_ # $_='a02756b636168620c62756072027568647f6e61620473757a6'; # # split an array ref into @_ : A R R A Y ( 0 x 8 a 6 f 0 1 c ) # split//,[q(just another perl hacker)]; # # set $} to this literal string # $}='chr((ord$_)+65)'; # # set $. to '0x' (taken from @_) # $.=join'',$_[6],$_[7]; # # load @| with $. ('0x') followed by the first $_ then the literal # numbers # # @| contains 0xa0275..,0x72,0x65,0x76,0x65,0x72,0x73,0x65 # @|=map{$..$_}(split,72,65,76,65,72,73,65); # # get rid of the first value (the long one) from @| # shift@|; # # assign $t the string or chars made from the ASCII values in @| # # $t now equals 'reverse' # $t=join'',map{eval'chr hex'}@|; # # split $_ on '02', reverse the whole thing and re-join with '20' # # $_ now equals '6a75737420616e6f74686572207065726c206861636b65720a' # $_=(join'20',(split/02/,eval $t))[0]; # # an extra semi colon? # ; # # assign the literal string to $$ # $$='print map{eval $}}@]'; # # loop through $_ finding pairs of characters. append $. ('0x') # before these then eval and chr them, before pushing onto @] # map{push@]=>chr(eval($..$&)-65)while s/..//}$_; # # evaluate $$ which adds 65 to each char in @] # eval$$; # # print output # print;

Replies are listed 'Best First'.
Re: Re: 2nd in as many days:
by the_slycer (Chaplain) on Jun 08, 2001 at 17:33 UTC
    Actually your last 2 are incorrect. The eval $$ takes care of the print - remember $$ was set to 'print map{eval $}}@]' (with $} being set to 'chr((ord$_)+65)' - this is what adds the 65). The last print was there just for redirection. It works because $_ is undef at this point.
      "i am a muppet" == true

Log In?
Username:
Password:

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

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

    No recent polls found