Good call. Perl's << is a bit different from the shell's, so you can't blindly translate print to echo in the perl code
print <<FOO
bar
FOO
This should probably be mentioned in perltrap, but it's not.
Aside from the quoting issue, it's never going to work the way deprecated seems to want, because environment variables don't get passed from child back to parent. If you want to set variables in your current shell, you need to do something like this:
$ eval `perl -e 'print "FOO=bar"'`
$ echo $FOO
bar
|