Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Dealing with "Detachments"

by joe++ (Friar)
on Oct 24, 2002 at 12:50 UTC ( #207684=note: print w/replies, xml ) Need Help??


in reply to Dealing with "Detachments"

Maybe a partial solution: if your stream is actually just a scalar (e.g. in variable $body), then you may treat is as a file handle via IO::Scalar. If the method you'd like to call accepts a filehandle, this does the trick:

use strict; use IO::Scalar; my $body = &get_body(); # whatever... my $handle = new IO::Scalar($body); # now call the method that expects a file handle
I used this succesfully on XML::Simple, which can be instantiated with either a filename or a filehandle. If your module really only groks filenames, then you're out of luck and may need to revert to a tempfile of some kind.

HTH!

--
Cheers, Joe

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2022-01-18 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (52 votes). Check out past polls.

    Notices?