Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- ##
- ## special-encode.pl
- ## Special encoding script:
- sub trim($)
- {
- my $string = shift;
- $string =~ s/^\s+//;
- $string =~ s/\s+$//;
- return $string;
- }
- $a = <>;
- $s = '';
- $a = trim($a);
- for ($i=0; $i<length($a); ++$i) {
- $c = substr($a, $i, 1);
- if ($c eq 'Z') {
- $s = $s . 'a';
- } elsif ($c eq 'z') {
- $s = $s . 'A';
- } elsif ($c eq '9') {
- $s = $s . '0';
- } else {
- $s = $s . chr(ord($c)+1);
- }
- }
- $s = scalar reverse trim($s);
- print $s;
Advertisement
Add Comment
Please, Sign In to add comment