Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to handle both a STDIN pipe and file from command line?

by Anonymous Monk
on Mar 14, 2013 at 04:04 UTC ( [id://1023361]=note: print w/replies, xml ) Need Help??


in reply to How to handle both a STDIN pipe and file from command line?

perldoc -f -x

-p File is a named pipe (FIFO), or Filehandle is a pipe.

if( -p STDIN ){ @stuff = <STDIN>; close STDIN; } while(<>){ ...

See Re^2: Write to existing file with character insert and Iterator::Diamond for a safer way

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1023361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found