Has anyone seen a good way to determine if a Perl script is running on an
interactive console vs. within a shell or Perl script? I have a code
snippet that I want to print more text to a console for the user to view,
but if it is within a script I don't want to clutter its output.<br/>
<br/>
On the Solaris system I'm running, I tried the "tty" command,
but both return "/dev/pts/8" when called from the command line
and within a script. The closest thing I can come to is the shell
variable $_: "-l" for interactive, and
"./<scriptname>" if run from a script.<br/>
<br/>
Any other ideas?<br/>
<br/>
Dan<br/>
<br/>
- - - -<br/>
"Wait for that wisest of all counselors, time." -- Pericles<br/>
"I do not fear computers, I fear the lack of them." -- Isaac
Asimov<br/>
"Soon we will be able to harness the rotational energy from Orwell's
grave to solve all world energy problems." -- /. user GigsVT
(208848)<br/>
GPG fingerprint:6FFD DB94 7B96 0FD8 EADF 2EE0 B2B0 CC47 4FDE 9B68