http://qs321.pair.com?node_id=664617


in reply to conditional self-execution

It all seems to work:
do "q.pl"; # prints module
./q.pl # prints script
# q.pl if (__FILE__ eq $0) { print "script\n"; } else { print "module\n"; }
-- gam3
A picture is worth a thousand words, but takes 200K.