Sturdevant, Robert W Mr CTR USA AMC wrote:
Hi group,

Hello,

I'm troubleshooting a perl 5.6 Win32 app that uses Net::FTP. I am trying
to ftp using a file handle instead of a local file name.

POD says something like $ftp->put(LOCAL_FILE [REMOTE_FILE]) where
LOCAL_FILE may be a file name or a file handle. I know $filename does
exist, I can see it!

This works: $ftp->put( $filename, $somename) ;

But this fails with "Cannot open local file HANDLE: No such file or
directory"

open( HANDLE, "< $filename");

You should verify that the file was opened correctly:

open HANDLE, '<', $filename or die "Cannot open '$filename' $!";

$ftp->put( HANDLE, $somename);

open() does open the file.  fileno() says a descriptor is assigned. The
error is thrown by put(), specifically IO::Handle. Can someone tell me
what I am doing wrong??

perldoc -q "How do I pass filehandles between subroutines"



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

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


Reply via email to