See perldoc -f -X:
my $loglevel; $loglevel++ if -t STDOUT; print "Log level is $loglevel\n";
This will not work if the user is running your program through less or any other pager I guess.
In reply to Re: How to tell whether script is invoked from command line or not
by Corion
in thread How to tell whether script is invoked from command line or not
by theguvnor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |