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;
In reply to Check links.. if they do exist, then print link to file...but how do i check the existance of a link?(validity?) by dark314
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |