On Wed, Apr 9, 2008 at 3:55 PM, Wagner, David --- Senior Programmer
Analyst --- WGO <[EMAIL PROTECTED]> wrote:
snip
> No. I want to do a put of a file, but without having to write
> the file first
> and then doing put(Filein,fileout). I could write out the 60 plus files
> each time, but
> I am trying to get the data to a file on the remote server without
> having a file on
> the input side.
> Understand?
snip
Ah, now it becomes clear. According to the Net::FTP docs the put
method accepts a file or a filehandle as the LOCAL_FILE argument. You
can create a filehandle out of a scalar like this (in Perl 5.8 and
later*):
open my $fh, "<", \$scalar
or die "could not create a filehandle for the data [$scalar]: $!";
Since the filehandle will not have a name you will need to use the
optional REMOTE_FILE argument:
$ftp->put($fh, $filename);
* There is another method for earlier versions of Perl, but it does
not come readily to mind. I believe you needed IO::String to do it
and there were problems with versions of Perl less than 5.6.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/