in reply to Altering an array with grep & map
Your usage is a little mixed up. grep and map each take a bit of code and a list, and each produces a list. They are commonly chained like this, my @foo = map { transform($_) } grep { choose($_) } @list; where you want to pick href and source attributes, you should craft choose() to return true for only the items you want to transform().
That said, there are modules which will do this for you much more easily and accurately. HTML::Parser and HTML::LinkExtor are worth a look, depending on what you want to do with the result. The latter does exactly what you say you want, up to the actual URI remapping. There are others in the HTML and XML namespaces, as well.
After Compline,
Zaxo
|
|---|