http://www.perlmonks.org?node_id=456565

devnul has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have several HTML links like the following:
<a href="url?page=1">10</a> <a href="url?page=2">20</a> <a href="url?page=3">30</a> <a href="url?page=2"><img src="next_image"></a>


I need to extract the last link (and only the last link) which contains the image. Is there a way to do this which I'm not seeing? I have tried using find_link, but not sure what I should be passing into it, if it is even possible.

I should probably mention that the actual URL for "20" and the image are identical to each other.

Thanks!

dEvNuL