#!/bin/sh -u # $0 arg # Running a Perl script inside a shell script. # Using different types of quoting to pass in variables. # -Ian! D. Allen - idallen@idallen.ca - www.idallen.com arg=$1 foo='this is foo' perl -w -e " # This section is double-quoted; shell variables will expand here. use strict; my \$arg = \"$arg\"; my \$foo = \"$foo\"; "' # <== this line changes from double to single quotes # This section is single-quoted; nothing expands here. print "The arg was \"$arg\" and foo was \"$foo\"\n"; '