Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Using the contents of

by JadeNB (Chaplain)
on Sep 22, 2008 at 18:53 UTC ( #713073=note: print w/ replies, xml ) Need Help??

in reply to Re: Using the contents of
in thread Using the contents of

You could tie the filehandle to a scalar, implementing the READLINE, GETC, and READ methods appropriately. See Tying Filehandles. (I thought there must be a CPAN module to do this—sort of the converse of Tie::File—but a cursory search didn't find it.)

UPDATE: IO::String and IO::Stringy both seem to be the sort of thing that you'd want here. The documentation suggests that they're only useful on older versions that don't support lexical filehandles, but it seems to me that lexical filehandles don't suffice for your situation.

UPDATE 2: ikegami pointed out what I was missing (i.e., why you shouldn't tie after all). Thanks!

Comment on Re^2: Using the contents of

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2015-11-30 17:48 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (778 votes), past polls