![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script to download files from a site? | paqman | Linux | 2 | 11-26-2008 04:44 PM |
| script for download files from ftp site | tiff-matt | Shell Programming and Scripting | 5 | 09-19-2008 03:46 PM |
| How to reconnect to online database? | vanitham | High Level Programming | 1 | 10-27-2007 10:29 AM |
| Online site on Makefile | bkausik | High Level Programming | 2 | 02-18-2002 05:05 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Reconnect and download data from online site
Hi, I have to connect to online site and download some data from the online site but sometimes the site which i have to connect will be busy or it will not be working in such a case i have to connect atleast 3 times and try to download the data. I tried like this: Code:
use CGI::Carp qw(fatalsToBrowser);
$url="http://www.xyz.com";
$ua = new LWP::UserAgent;
$tries=0;
eval
{
$response=$ua->get($url);
};warn $@ if ($@);
if ($@) {
die "Server error: $@. Try again later" ;
$tries++;
if($tries == "3")
{
print "\nstop connecting\n"
}
}
Actually i am stuck up here if there is any error it is not displaying i.e its not entering if($@) block . How to reconnect again??? Basically i have to reconnect and download the data when the site is not working. How to reconnect to the site and download the data??? Any suggestions ??? Regards Vanitha Last edited by Franklin52; 05-06-2009 at 05:34 AM.. Reason: code tags |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|