Simpler:
use v5.14; sub encode_decode { shift =~ tr/A-Za-z/ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgf +edcba/r; } my $enc = encode_decode("this is a test"); my $dec = encode_decode($enc); say "Enc: ", $enc; say "Dec: ", $dec; __END__ Enc: gsrh rh z gvhg Dec: this is a test
In reply to Re^2: Encryption/Decryption Program:
by tobyink
in thread Encryption/Decryption Program:
by Perl Beginner01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |