[Omaha.pm] Detecting interactive console vs. in a script.

Andy Lester andy at petdance.com
Thu May 18 08:48:54 PDT 2006


On May 18, 2006, at 10:19 AM, Daniel Linder wrote:

> 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.

This is covered in detail in the FAQ.

$ perldoc -q interactive

Found in /System/Library/Perl/5.8.6/pods/perlfaq8.pod
        How do I find out if I’m running interactively or not?


--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance





More information about the Omaha-pm mailing list