Here's a copy of the script up until the login error :
#!/usr/bin/perl -w
print "Enter the full name of the file you are looking for:\n" ;
chomp ($url=<STDIN> );
if ($url =~ m|http://|i)
{
print " You have chosen a file of type HTTP! ";
#use perl -MLWP::Simple 'getprint $url';
use lib 'LWP::Simple' ;
use LWP::Simple ;
$doc = get ($url) ;
print $doc;
}
elsif ($url =~ m|ftp://|i)
{
print "You have chosen a file of type FTP! ";
use lib 'Net::FTP' ;
use Net::FTP;
print "Username?";
chomp ( $username = <STDIN> );
print "Password?";
chomp ($password = <STDIN> );
print "ftp_home?";
chomp ($ftp_home = <STDIN> );
print "The filename you are searching for is...";
chomp ($filename = <STDIN> );
$ftp = Net::FTP->new($url, Debug=>0);
$ftp->login( $username, $password );
The complete error message is :
Can't call method "login" on an undefined value at D:\sparkle\perl6.pl line
50, <STDIN> line 5.
There you go. It's driving me crazy because I just can't seem to see what's
wrong. Help!
Thanks,
Sparkle
>From: Bob Showalter <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: RE: ftp login
>Date: Fri, 3 Aug 2001 10:52:11 -0400
>
> > -----Original Message-----
> > From: Sparkle Williams [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 03, 2001 10:49 AM
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: ftp login
> >
> >
> > I do have "use Net::FTP at the beginning of my script, but
> > even when I use
> > an anonymous login, it still gives me the same error of
> > "can't call login"
> > Also, I have scalar values in within the parenthes, should I
> > be using double
> > quotes around those?
> > Thanks!
>
>I don't think you're posting the entire error message, so do that. And post
>the entire script up to the login call. I am guessing that either you are
>not initializing $ftp at all or that the call to Net::FTP::new() is failing
>and you are not checking for that.
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
_________________________________________________________________
Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]