Notice the scalar reference when using this technique.
#!/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 $!;
my $count = 0;
for(1..100){
print FILEHANDLE $count;
# print "$foo\n";
# select(undef,undef,undef,.1);
$count++;
}
close FILEHANDLE or die $!;
print "###########################\n";
print "$foo\n";
I'm not really a human, but I play one on earth.
flash japh
|