in reply to Help Getting WWW::Mechanize Link reference array to output to STD_OUT.

Maybe Fetching links with www::mechanize and WWW::Mechanize and following multiple links would help you out.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: Help Getting WWW::Mechanize Link reference array to output to STD_OUT.

Replies are listed 'Best First'.
Re^2: Help Getting WWW::Mechanize Link reference array to output to STD_OUT.
by tfredett (Sexton) on Jul 03, 2012 at 18:22 UTC

    So first off, sorry, I forgot to run a search, I am normally more on top of things like that :).

    I checked out both links, and of the two, Fetching links with WWW::Mechanize seemed to be the one relevant to me as WWW::Mechanize and following multiple links results in the problem of getting bad links.

    In Fetching links with WWW::Mechanize, the OP, was having the same issue I am, however I have tried the solutions in the two posts there already. I have both searched through WWW::Mechanize::Link and have tried to use the built in functions (as seen in the foreach loop) as well as the other post using a similar foreach loop that I have, (I have tried that foreach loop as well, to make sure that it was not just the loop.) Perhaps I am using the reference incorrectly?

      Perhaps I am using the reference incorrectly?

      No, not really. While you're not coping with scoping you're using find_all_links... correctly

      Try it yourself

      $ mech-dump --links http://example.com /_css/2008.1/reset-fonts-grids.css /_css/2008.1/screen.css

      What version of mechanize do you have?

      Upgrade upgrade upgrade

        I am currently using WWW::Mechanize version 1.72 (read: latest version).

        I will check out the link you provided, and return with an update on my findings, thanks for the help!

        UPDATE: so after looking through the links provided above, I am rather confused by what you mean by saying "While you're not coping with scoping you're using find_all_links... correctly" I have looked, and my scope appears to be within the same block, and as such should be able to see it during execution time, which yields true, if you take the return of find_all_links and place it in a scalar, as it returns a reference to an array. So perhaps I am just blind, but I am missing what you mean. Would you mind expanding on what you mean, in an effort to help me understand?