I have a handy-dandy script that replaces text in files. Very slick:
% replace 'dog' 'cat' myfile.txt 1. myfile.txt (1 change) But I'd also like it to be able to act on a pipe if there is one: % cat myfile.txt | replace 'dog' 'cat' My cat has fleas. The problem is I don't want to use the diamond operator if the pipe is empty because it waits for keyboard input, and I don't want it to. Is there a way to check to see if there's anything coming down a pipe? TIA. - Bryan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>