I don't know if this works on Windows, but how about using the often discussed "using a variable as a filehandle".
#!/usr/bin/perl
#Do you want to use a perl variable as if it were a file?
#Previous versions of perl had IO::Stringy and IO::Scalar for that.
#Perl 5.8 with PerlIO has it natively. Just use a reference to
#the scalar in the filename slot of open.
my $foo = '';
open FILEHANDLE, '+>', \$foo or die $!;
print FILEHANDLE "Contents of File";
seek(FILEHANDLE,0,0);
my @contents = <FILEHANDLE>;
close FILEHANDLE or die $!;
print 'From $foo: ', $foo, $/;
print 'From file read: ', @contents, $/;
I'm not really a human, but I play one on earth.
flash japh
|