Re: [Perl-unix-users] Checking for input, perl 5.6.1 on Solaris 9, sparc...

2004-10-12 Thread Schuyler Bishop
Thank you VERY much to everyone that responded - the winning solution turned out to be a (-p STDIN) test for - you guessed it, a named pipe. That simple solution eluded me and I thank James who replied to me off-list for it and for not flaming my stupidity. ;) Also thanks to Dale and Martin, bot

Re: [Perl-unix-users] Checking for input, perl 5.6.1 on Solaris 9, sparc...

2004-10-12 Thread Roger Keane
Schuyler Bishop wrote: [snip] I've googled this pretty extensively and searched the archives equally vigorously and came up with the 'if (-f)', but neither that nor 'if (-t) seem to ever return a 1 so that the loop is executed. The file test operators need a file handle. The default is '_' which

Re: [Perl-unix-users] Checking for input, perl 5.6.1 on Solaris 9, sparc...

2004-10-12 Thread Martin Moss
If you can decide at command line time which type of input to use, e.g. using | or a file, then why not write your script to use GetOpts::Std Then you can use the -w as usual, and create a new switche (-f <$filename> for file) and no switch for STDIN. Then in your script you can simply check for t

[Perl-unix-users] Checking for input, perl 5.6.1 on Solaris 9, sparc...

2004-10-12 Thread Schuyler Bishop
Hello, Long-time perl wanna-be-hacker, first time poster here. This script is running on a Sunblade 100 running Solaris 9 and the current sun version of perl(based on recommended patch clusters) - 5.6.1. I've got a script where I'm trying to read a list of files and switches, sometimes from and