in reply to Re: perl script inside a shell script
in thread perl script inside a shell script

Very nice! As another way of doing it, using quotes around the here-doc terminator saves you from having to backslash all those special characters.
#!/bin/sh echo This is bash i=12 echo $i perl - $i <<'__HERE__' my $i = shift; print "This is perl\n"; print ++$i . "\n"; __HERE__ echo This is bash again echo $i
Because << is a redirection to STDIN, in order to add $i to the command line I also had to add - so that perl would know to read the script from STDIN.