When you run the Unix shell script, you can specify the -x option so that the shell prints a valid command that is executed after all the interpolation is complete. For example, if we run this script (script.sh):
#!/usr/bin/sh var='hello, world' echo $var
with:
sh -x script.sh
we get
+ var='hello, world' + echo hello, world hello, world
How can I get the same behavior for a perl script?
source share