Ken Barker wrote:

> Guru's
> 
> I am using the module Net::FTP::Common.  Here is a snip of some code I am 
> using:
> 
> use strict;
> use warnings;
> use Net::FTP::Common;
> 
> my $outputpath2 = "C:\\Perl_Code\\";
> my $outfile1 = "ken.pl";
> 
> my ($ez,%netftp_cfg,%common_cfg,$fail1);
> 
> %common_cfg =    
>     (
> 
>      User => 'user',           
>      Pass => 'pass',
>      LocalDir => $outputpath2,
>      LocalFile => $outfile1,
>      
>      
>      Host => 'xxx.xxx.xxx.xxx',          
>      RemoteDir  => '/path/path',               
>      Type => 'I'                     
>      #default;
>      );
> 
>      $ez = Net::FTP::Common->new(\%common_cfg, \%netftp_cfg); 
>      $ez->put($outfile1) || warn ($fail1 = "FTP of $outfile1 failed\n");
>      
>     
> I would like to capture any error message as text and save them to a variable 
> for later use.  Any suggestions?

I normally use Net::FTP, so I'm not sure about the Common specifics.

You could try eval'ing the put and check for errors or you can try
capturing STDERR/STDOUT using IO::Capture module.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to