http://www.perlmonks.org?node_id=1007531


in reply to Re: Rot13 Challenge
in thread Rot13 Challenge

my $input; print "Please Enter String to be encrypted or decrypted"; $input = <>; chomp $input; my @asciich; while($input=~ m/(.)/g) {push @asciich,ord ($1);} my $count=scalar(@asciich); print "Ascii values -----> @asciich\n"; for(my $i=0;$i<$count;$i++) { if (($asciich[$i] >= 65 && $asciich[$i] <= 77)|| ($asciich[$i] >= 97 & +& $asciich[$i] <= 109)) { $asciich[$i] = $asciich[$i]+13; } else {$asciich[$i] = $asciich[$i] - 13;} } print "Encrypted values -----> @asciich\n"; foreach(my $i=0;$i<$count;$i++) { $asciich[$i]=chr($asciich[$i]);} print "encrypted output ------> @asciich\t";