yitzchak on the CB made me realize I may have misunderstood what you were doing:
The output of Data::Dumper should allow you to find which version suits your needs the best.use strict; use warnings; use Data::Dumper; use WWW::Mechanize; my %links; for my $cnt (1..3) { my $url = "http://www.foo.com/p/$cnt"; my $mech = WWW::Mechanize->new(); $mech->get($url) or die "no such url"; my @link = $mech->find_all_links(tag => "a", class => "foo") or die + "can't find link"; $links{$cnt} = \@link; } # Do something with @link here, after the loop is done print Dumper \%link; # Show the content of %link
In reply to Re^2: how to store link array in for loop with WWW::Mechanize
by Eily
in thread how to store link array in for loop with WWW::Mechanize
by haiihh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |