In perl, if I have a pgm:

while (<>) {
    print "this is the line: $_";
}

normally I'd invoke the pgm like:

echo "repeat this line" | ./pgm

But if I accidentally invoke it like:

./pgm 

How would I prevent the while loop from running (i.e. pseudocode):

while (<>) if (exists <STDIN>) {
    print "$_";
}

Thanks
Jay
 
Jay Strauss
[EMAIL PROTECTED]


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to