Access to Perl's empty angle "<>" operator from an actual filehandle?

Posted by Ryan Thompson on Stack Overflow See other posts from Stack Overflow or by Ryan Thompson
Published on 2009-10-29T00:29:16Z Indexed on 2010/04/26 4:53 UTC
Read the original article Hit count: 327

Filed under:
|
|
|

I like to use the nifty perl feature where reading from the empty angle operator <> magically gives your program UNIX filter semantics, but I'd like to be able to access this feature through an actual filehandle (or IO::Handle object, or similar), so that I can do things like pass it into subroutines and such. Is there any way to do this?

This question is particularly hard to google, because searching for "angle operator" and "filehandle" just tells me how to read from filehandles using the angle operator.

© Stack Overflow or respective owner

Related posts about perl

Related posts about filehandle