Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

decrypt that wiked code snippet

by AlexTape (Monk)
on Sep 10, 2013 at 12:55 UTC ( #1053250=perlquestion: print w/ replies, xml ) Need Help??
AlexTape has asked for the wisdom of the Perl Monks concerning the following question:

> #!/usr/bin/perl -w > use strict; > > my$f= $[;my > $ch=0;sub l{length} > sub r{join"", reverse split > ("",$_[$[])}sub ss{substr($_[0] > ,$_[1],$_[2])}sub be{$_=$_[0];p > (ss($_,$f,1));$f+=l()/2;$f%=l > ();$f++if$ch%2;$ch++}my$q=r > ("\ntfgpfdfal,thg?bngbj". > "naxfcixz");$_=$q; $q=~ > tr/f[a-z]/ [l-za-k] > /;my@ever=1..&l > ;my$mine=$q > ;sub p{ > print > @_; > } > > be $mine for @ever >

prints:

Replacement list is longer than search list at heart.pl line 14. kristen, will you marry me?

So anybody can decrypt that?! im absolutely stucked by understanding this :D
(think i found it here in the forum?! dont know atm)

kindly perlig

$perlig =~ s/pec/cep/g if 'errors expected';

Comment on decrypt that wiked code snippet
Select or Download Code
Re: decrypt that wiked code snippet
by choroba (Abbot) on Sep 10, 2013 at 12:58 UTC
    Have you tried running it with
    perl -MO=Deparse heart.pl
    ?
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      awesome!!
      # perl -MO=Deparse heart.pl Replacement list is longer than search list at h.pl line 14. BEGIN { $^W = 1; } use strict 'refs'; my $f = $[; my $ch = 0; sub l { length $_; } sub r { join '', reverse(split(//, $_[0], 0)); } sub ss { substr $_[0], $_[1], $_[2]; } sub be { $_ = $_[0]; p(ss($_, $f, 1)); $f += l() / 2; $f %= l(); ++$f if $ch % 2; $ch++; } my $q = r("\ntfgpfdfal,thg?bngbjnaxfcixz"); $_ = $q; $q =~ tr/[]a-z/[]l-p r-za-k/; my(@ever) = 1 .. &l; my $mine = $q; sub p { print @_; } be $mine foreach (@ever); heart.pl syntax OK
      whats about $^W ? what is that :D ? and $[ ??
      $perlig =~ s/pec/cep/g if 'errors expected';
Re: decrypt that wiked code snippet
by Anonymous Monk on Sep 11, 2013 at 01:43 UTC
      thanks! glad to get that..
      $perlig =~ s/pec/cep/g if 'errors expected';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1053250]
Approved by NetWallah
Front-paged by NetWallah
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-09-17 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls