> -----Original Message-----
> From: Chas. Owens [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, April 09, 2008 13:05
> To: Wagner, David --- Senior Programmer Analyst --- WGO
> Cc: beginners@perl.org
> Subject: Re: Example of FTP w/o Input file? Is it possible to 
> do or not?
> 
> 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);
> 
        Works like a charm and makes it a much easier setup verses
having to
Create and then send the file.

        I appreciate the assistance.

Wags ;)

> * 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.
> 

**********************************************************************
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**********************************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to