in reply to Caesar Cipher
However, since this smells like like a homework assignment, and you are new to Perl, I would be inclined to suggest something a little more generic -- use an array.
It would be slower, but since you would be building the underlying mechanisms, you would understand its workings more thoroughly.
I know you are essentially asking for theoretical guidance, but have you done any work on this so far? Like, for example, the code which collects the text to be so ciphered?
For example -- intentionally silly:
#!/usr/bin/perl use strict; { foreach my $inputString (@inputArray) { my $cipheredText = &ceaser_cipher($inputString); print "'$inputString' becomes '$cipheredText'\n"; } } exit; sub cipheredText { my ($rawText, @otherParameters) = @_; # The magic happens here -- have entered a SoPW request at PerlMo +nks. } __END__
|
|---|