in reply to Script running online?
if (-t STDIN) { print 'running in terminal'; } else { print 'running in batch'; } [download]