Sui Ming Louie wrote:

> Is there a way to put the transfer mode inside the constructor of an FTP
> session?

Does not appear to be.  It needs to send the TYPE command to the remote,
so you'll need to do it by command as in your second case.  You could
of course use the '? :' syntax to do it rather than the 'if' if you like.

> 
> my $ftp = Net::FTP->new ($opts{'h'},
> 
>   Debug => 0,
> 
>   Type => ($opts{‘a’} ? ‘ASCII’ : ‘BINARY’)  # is this a valid option
> 
>                                                               # inside
> the constructor?
> 
> );
> 
> Or, do I have to use one of the methods (ascii or binary)?
> 
>   # =====================================
> 
>   # set transfer mode (ASCII or binary)
> 
>   # =====================================
> 
> if ($opts{'a'}) {
> 
>   $ftp->ascii();
> 
> } else {
> 
>   $ftp->binary();
> 
> } # if



-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
  • Net::FTP Sui Ming Louie
    • $Bill Luebkert

Reply via email to