dark314 has asked for the wisdom of the Perl Monks concerning the following question:
Here is my goal. Note in my code that i'm printing to F, a file. unfortunately this file is very large with alot of links that dont exist in the first place. I want to be able to check the link, and if it exists put it in the file, therefore wasting less time viewing the html file when it is finished. Any ideas? THANK YOU.
NOTE: $lead and $num are merely because there are 3 chars in the possible jpg file, so dont worry about that.
#!/usr/bin/perl $num = 0; open F, ">datafile" or die "Can't open $f : $!"; for ($i = 1;$i<=1000;$i++){ if ($num < 10) { $lead = "00"; } elsif ($num < 100 && $num >= 10) { $lead = "0"; } else { $lead = ''; } print F qq(<img src="http://somewebsite/65081) . $lead . $num . q( +.jpg">) . "\n"; $num++; } close F;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check links.. if they do exist, then print link to file...but how do i check the existance of a link?(validity?)
by davido (Cardinal) on Jul 27, 2006 at 19:32 UTC | |
|
Re: Check links.. if they do exist, then print link to file...but how do i check the existance of a link?(validity?)
by Albannach (Monsignor) on Jul 27, 2006 at 19:20 UTC | |
by Anonymous Monk on Jul 27, 2006 at 20:14 UTC | |
|
Re: Check links.. if they do exist, then print link to file...but how do i check the existance of a link?(validity?)
by rodion (Chaplain) on Jul 27, 2006 at 19:29 UTC | |
by CountZero (Bishop) on Jul 27, 2006 at 20:39 UTC |