Both of these map method calls work (produce the intended result) but I'm scratching my head how / why they work given the documentation on the Mojo::Collection
map method (and the source too). The first example sure looks like a hash element being passed and the second example, a string, neither of which appear to be a callback or method reference shown in the documentation. Curiously, these map method calls look like the method signatures for the Mojo::DOM
attr method.
Instead of the map calls in the above, could / should I be using attr method calls? But the result of a $dom->find() call is a Mojo::Collection object... and attr is a Mojo::DOM method.
Clearly, I'm missing something fundamental here. Help?
And one more newbie question, is there a good reason (e.g., backward compatibility with earlier releases) to use the Mojo::Collection
to_array method to access an element of a Mojo::Collection?