Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: in memory files in 5.6.1

by mandog (Curate)
on Oct 25, 2003 at 20:07 UTC ( #302102=note: print w/ replies, xml ) Need Help??


in reply to Re: in memory files in 5.6.1
in thread in memory files in 5.6.1

Thanks Liz

update: Thanks hanenkamp

IO::stringy looks useful, but as far as I can tell an stringy object can't be treated exactly like a file handle.

For example I have to invoke the print method of the object instead of printing to a file handle


Comment on Re: Re: in memory files in 5.6.1
Re: Re: Re: in memory files in 5.6.1
by hanenkamp (Pilgrim) on Oct 25, 2003 at 20:33 UTC

    Not true, this should work:

    use IO::Scalar; my $fh = IO::Scalar->new; print $fh "foo\n"; # Rather than $fh->print ... # or, if you prefer select $fh; print "bar\n";

    This works through the magic of a tied file handle. See perltie for details on tying a file handle.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-03 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls