SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's this error?

    Can anyone tell me why I get the following error message when running this script?
    Name "main:erl" used only once: possible typo at C:\Perl\bin\taxidermia.pl lin
    e 4.
    Use of uninitialized value in concatenation (.) or string at C:\Perl\bin\taxider
    mia.pl line 4.

    Code:
    #!/usr/bin/perl -w
    
    use Net::FTP;
    $ftp=Net::FTP->new("$ARGV[0]",Debug=>0) || die "Cannot connect to Host $ARGV[0]\n Usage: $perl taxidermia.pl target_ip\n";
    $ftp -> login("anonymous","anonymous") || die "Could not Login...Retry";
    
    while(1)
    {
    #this loop runs infinitely
    
    $ftp -> cwd();
    }
    
    $ftp->quit;

  2. #2
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its a warning. The scalar $perl is used only once in the code you posted and appears to have no value. Maybe you meant "perl" instead of "$perl".

  3. #3
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should escape the '$perl' in your 4th line because Perl treats it as a variable.
    die "Cannot connect to Host $ARGV[0]\n Usage: \$perl taxidermia.pl target_ip\n";


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •