in reply to Re: Using the contents of
in thread Using the contents of
my $data = '...'; open(my $fh, '<', \$data) or die; sub_that_needs_file_handle($fh);
Before 5.8, IO::Scalar and IO::String provide the functionality (although not as well) by using tie
Neither tie nor this method produce a real (system) file handle, so they won't work where a real file handle is needed. For example, you can't use them to capture the output of a child process. (See IPC::Run for a solution in that particular case.)
|
---|