Net::FTP=GLOB(0x82bce74)>>> STOR /private/myips Net::FTP=GLOB(0x82bce74): Timeout at myip.pl line 43 put failed at myip.pl line 43. #### #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use HTTP::Request; use Net::FTP; $| = 1; print "Getting local ip...\n"; my $local_ip = qx/ifconfig eth0|grep -m 1 inet|awk {\'print \$2\'}|cut -d \':\' -f2/; chomp($local_ip); print "Got local ip: $local_ip\n"; print "Getting remote ip...\n"; my $remote_ip; my $url = "http://www.whatismyip.com/"; my $ua=new LWP::UserAgent; my $request = new HTTP::Request('GET',$url); # create the http request my $response=$ua->request($request); # perform the http request my $whatisipsite = $response->as_string(); # store the response as a string if ($whatisipsite =~ /(Your ip is )+(.*?)( WhatIsMyIP.com)/) { # parse out the IP address $remote_ip = $2; } chomp($remote_ip); print "Got remote ip: $remote_ip\n"; my $newipfound = 0; open (my $infile, "myips") or die "Can't open file $!"; while (<$infile>) { if (/$local_ip|$remote_ip/) { } else { $newipfound = 1; } } close $infile; if ($newipfound) { print "New ip found! Sending file to web site...\n"; open (my $outfile , ">myips") or die "Can't open file $!"; print $outfile "$local_ip\n$remote_ip\n"; close $outfile; my $ftp = Net::FTP->new("www.techfeed.net", Debug => 1); $ftp->login("*****",'*****'); $ftp->cwd("/private"); $ftp->ascii(); $ftp->put("myips","/private/myips") or die "put failed ", $ftp->message; $ftp->quit; print "File sent!\n"; }