Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Can a script tell if it is being run from inside a script versus in an interactive terminal session?by BrowserUk (Patriarch) |
on Nov 07, 2014 at 20:59 UTC ( [id://1106532]=note: print w/replies, xml ) | Need Help?? |
You might try seeking on STDIN. If its connected to a redirected file, it should succeed; if its a pipe it will fail:
Put the seek in a die block and check for the error condition. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|