> What is unexpected about this?  Your error is being caught, and the
> first line is just a warning, and a pretty useful one at that.


>From the Net::FTP documentation:


get ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )

Get "REMOTE_FILE" from the server and store locally. "LOCAL_FILE" may be a
filename or a filehandle. If not specified, the file will be stored in the
current directory with the same leafname as the remote file.
If "WHERE" is given then the first "WHERE" bytes of the file will not be
transfered, and the remaining bytes will be appended to the local file if it
already exists.
Returns "LOCAL_FILE", or the generated local file name if "LOCAL_FILE" is
not given. If an error was encountered undef is returned.


So the expected behaviour would be return undef and put the warning in
$ftp->message as the other functions do.


> What is the actual behaviour you are after?  What are you trying to
> prevent?  Why wouldn't you want to check for the existence of the
> destination directory, considering for completeness you should be
> checking for it?


I initially wanted to prevent my script to start creating a bunch of
directories if someone f*uck up the configuration file.
But as you suggested, I should be checking for existance rather than just
create the dir ;)


> For efficiency's sake you shouldn't even bother connecting if the
> destination doesn't exist, at least in the snippet you have shown us.


Yeah, it was a quick cut & paste "test script".

Thanks!!


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


Reply via email to