in reply to Passing values between shell and Perl scripts
One way to do this is to call the perl script with the variable as an argument. You can then use @ARGV to get the variable and mess with it. To get it back out you can set an env variable and manipulate it in the shell script again.
Good Luck.
Josh