You are going to develop a PERL script that will perform encoding and decoding of plain
text messages. It must exhibit the following behavior:
The script is to be called encode (note: no .pl on the end)
input (the message to decode or encode) will be accepted on STDIN
output (the result of processing the message) will be sent to STDOUT
Any error messages will be sent to STDERR
The script will have 1 compulsory command line argument which is the key to use for decoding or encoding. It will default to encoding the message if no other
command line argument is specified. An optional second command line argument is
to specify the action to be taken (encode or decode the message), -e means encode
the message, -d means decode the message. When given 2 command line
arguments the script should be able to accept them in either order.
The script needs to do basic checking which includes the following:
If no arguments are given the script must exit giving an error message stating how the script is to be used and that no command line arguments were given
If more than 2 arguments are given the script must exit giving an error message stating how the script is to be used and that too many command line arguments were
given
The key can only contain lower case letters (ie a-z) and can not contain more than 1 of any letter. You need to check for this and exit giving an error message if
necessary.
The script will handle uppercase as well as lowercase (ie a-z and A-Z) but will ignore everything else (ie numbers, spaces, punctuation etc.).
Your script must have commenting (Don't go overboard on commenting