http://qs321.pair.com?node_id=1053250

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?! i´m 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';

Replies are listed 'Best First'.
Re: decrypt that wiked code snippet
by choroba (Cardinal) 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';