in reply to How to tell whether script is invoked from command line or not
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.
|
|---|