Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
A few general suggestions (I haven't read your code thoroughly, sorry):
Pack your things (e.g. If the Link is broken, it is testing it if there's only a problem with the subfolder and generating a new url. Testing the head of this link) together in subroutines, your code will be clearer, more scalable. Open and write to files once, don't open them every time. (time, performance) About the question: If you find a broken link, you could save the line numbers in an array, and after you checked each line, you can delete the lines. One solution that comes into my head is with Tie::File Example of deleting the last line from a file, stolen from the Cookbook (hellyea, I am lazy):
I'm too lazy to be proud of being impatient. In reply to Re^3: Find & Delete by comparing two files
by nemesdani
|
|