Eric Wang <ericw12@...> writes:
> Hi guys,
Hi Eric,
> >
> I am using activeperl 5.8 and try to check if files are exist on a remoteftp
server,
> but I got tons of stuff in stardard error, I guess.
>
> ....
> $common_cfg = { Host => $ftpserver,
> User => $username,
> Pass => $password,
> RemoteDir => $RemoteDir
> } ;
>
> my $ftp = Net::FTP::Common->new($common_cfg, Debug => 0);
>
> $ftp->login or die sendmail($smtp,$from,$to,"Report Job: CUCBC FTP logon
failure");
You never have to call login() before using a Net::FTP::Common method
> foreach (@files) {
> my $exist=$ftp->exists(RemoteFile => $_);
> print "$_ : $exist\n";
> }
> $ftp->quit;
> ...
>
> The script supposes only to print this
>
> DAIL0822.015 : 0
>
> But instead of it print all this crap below,
sorry, here's a fix for line 249 in Common.pm
warn sprintf "[checking @listing for [%s]]", $rf if $self->{Debug} ;
> and with this "Not a GLOB reference at C:/Perl/lib/Net/FTP.pm line
> 1103." Help please, I guess if this doesn't work, I will have to
> look at LWP.
That is just a warning. The docs for Net::FTP::Common discuss this in
the NOTES section.