[Israel.pm] converting string to file name

Gaal Yahas gaal at forum2.org
Mon Jun 7 02:40:23 PDT 2004


On Mon, Jun 07, 2004 at 12:28:46PM +0300, Itamar Elem wrote:
> ibe got pel string in var (say $buffer) and function which reuire  file name as one of its arguments(the function belong to external module. cant change) the file name content should be $buffer. here there away which i can convert $buffer sow i can send it to the function instead of the file name

This time it sounds like you must write out the data into a file.

open my $fh, ">$name" or die "can't open $name: $!";
print $fh $buffer; # note: no comma.
close $fh or die "can't close $name: $!";

external_library_function($name);

Note that you have to close the file before calling the external
function, so that the write buffer is flushed.

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list