FAQ
I'm building an FTP client using NET::FTP. The documentation states that the new constructor has a host option which can be a reference to an array with hosts to try in turn. I don't seem to be able to get this to work. I'm using ActivePerl under Windows XP. Here's my code:

@try_these = ("turing.unh.edu", "euler.unh.edu");
$ftp = Net::FTP->new(Host => @try_these)
or die "Can't connect: $@\n";

And here's the error message:

Can't connect: Net::FTP: Bad hostname 'Host'

Any ideas? Thanks guys!
_________________________________________________________________
Bing™ brings you maps, menus, and reviews organized in one place. Try it now.
http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1

Search Discussions

  • Jefferson Kirkland at Jul 19, 2009 at 1:24 am
    Sorry, original message had wrong address for this list and I didn't
    notice. Here is the chain.

    Regards,

    Jeff



    ---------- Forwarded message ----------
    From: Jefferson Kirkland <numberwhun@gmail.com>
    Date: Sat, Jul 18, 2009 at 9:17 PM
    Subject: Re: NET::FTP object constructor's host option as array reference
    To: Corey Foote <coreyfoote@hotmail.com>
    Cc: beginners-help@perl.org


    While I am sure that someone here can figure out the issue with the array
    reference, I am not in a good mind state to mess with it. I would cycle
    through the array with a foreach as shown on this
    page<http://aplawrence.com/Unixart/perlnetftp.html>.
    As shown on there, this gives you control over the connection to each and
    you can either use it to test the connections, or try each until
    connection.

    Regards,

    Jeff



    On Sat, Jul 18, 2009 at 4:44 PM, Corey Foote wrote:


    I'm building an FTP client using NET::FTP. The documentation states that
    the new constructor has a host option which can be a reference to an array
    with hosts to try in turn. I don't seem to be able to get this to work. I'm
    using ActivePerl under Windows XP. Here's my code:

    @try_these = ("turing.unh.edu", "euler.unh.edu");
    $ftp = Net::FTP->new(Host => @try_these)
    or die "Can't connect: $@\n";

    And here's the error message:

    Can't connect: Net::FTP: Bad hostname 'Host'

    Any ideas? Thanks guys!
    _________________________________________________________________
    Bing™ brings you maps, menus, and reviews organized in one place. Try it
    now.

    http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TXT_MLOGEN_Local_Local_Restaurants_1x1

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJul 18, '09 at 8:45p
activeJul 19, '09 at 1:24a
posts2
users2
websiteperl.org

2 users in discussion

Corey Foote: 1 post Jefferson Kirkland: 1 post

People

Translate

site design / logo © 2021 Grokbase