cyber-guard has asked for the wisdom of the Perl Monks concerning the following question:
Firstly why the script fails to rotate the letters by one, if I remove either $_++ (I've tested several combinations with and operator, and that didn't work either)? Also that might be just me not fully understanding the implications of the eval string hack, but why won't $_++ for 1..13 or $_ += 13 work?#!/usr/bin/perl use 5.12.0; my @rot = qw(a v c g h t); @rot = map {$_++;eval;$_++} @rot; say @rot;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rot13 encryption
by moritz (Cardinal) on Feb 06, 2011 at 18:50 UTC | |
by cyber-guard (Acolyte) on Feb 06, 2011 at 19:19 UTC | |
|
Re: Rot13 encryption
by wind (Priest) on Feb 06, 2011 at 19:49 UTC |