in reply to Re: File source from memory
in thread File source from memory

Thanks for your help, I do know I have to strip the file name but I do NOT want to save the file to my server. I want to read the data from the file directly and write it to the database. How can I do this without first saving the file?

Replies are listed 'Best First'.
Re^3: File source from memory
by zentara (Cardinal) on Feb 19, 2005 at 13:27 UTC
    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