in reply to web spider

Is there any way to do the same in Perl.

Yes: linklint.