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? 

If you mean your "warn" message, all you need to do is redirect the
STDERR file handle to a scalar. See 'perldoc -f open' for how to do
that. See the 'open FILEHANDLE,MODE,REFERENCE' variant, which is new in
Perl 5.8.

HTH

-- 
Brian Raven



=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the 
intended addressee(s). Unauthorised reproduction, disclosure, modification, 
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message do not 
necessarily reflect those of Atos Euronext Market Solutions.

L'information contenue dans cet e-mail est confidentielle et uniquement 
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. 
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail 
vous parvient par erreur, nous vous prions de bien vouloir prevenir 
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre 
systeme. Le contenu de ce message electronique ne represente pas necessairement 
la position ou le point de vue d'Atos Euronext Market Solutions.


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

Reply via email to