Wiggins D Anconia wrote:
>
> Rob wrote:
> >
> > The backticks are your problem: they will make Perl shell out to execute
> > the string as a command. The 'sh: line1:' in your error message is the
> > clue. Presumably you don't have execute permission for
> > '../path/to/02192004-www.tar.gz'?
> >
> > Try this and see if it works any better:
> >
> >   my $ip = '192.168.0.2';
> >
> >   $ftp = Net::FTP->new($ip, Debug => 1)
> >     or die "Could not establish connection to $ip: $@";
> >
> >   $ftp->login('user', 'password')
> >     or die 'Could not login ', $ftp->message;
> >
> >   $ftp->put('../path/to/*-www.tar.gz')
> >     or die 'Could not transfer files ', $ftp->message;
> >
>
> Yes, but the OP might be trying to glob based on the *. Unless he really
> does have a file named '*-www.tar.gz', but I took this to mean a file
> glob, in which case his use of 'put' is wrong.  'put' takes a single
> file or filehandle and optionally a remote file name.  The OP will need
> to file glob into a list then step through the list to transfer multiple
> files.
>
> foreach my $file (glob('../path/to/*-www.tar.gz')) {
>   $ftp->put($file) or die ....;
> }
>
> But maybe I am reading too much into it...

No I think you're right Wiggins. This is what comes of me
forgetting to remove my Windows hat before I put the Unix
one on!

What does qx/*/ actually do? I guess the shell just expands
into a list of actual files and then tries to execute the
first one? I can't try it right now.

Thanks for the fix.

Rob



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