in reply to Problem with assignment for class...

What's the textbook? It seems like it contains untested code. That for loop seems a bit strange, and where does "$size" come from? It looks like a very non-native-perl way to loop through an array.

The line

$value =~ s/+/\ $1/g;

looks like it's trying to replace plus-signs with spaces, which is logical, but I don't understand the right hand side -- that slash doesn't make sense and neither does the $1. And as pointed out before, it ignores the plus sign's special character status it fails. The left hand side of it at least should be this:

$value =~ s/\+/\ $1/g;


($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss') =~y~b-v~a-z~s; print