Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Loop will not save into the array

by Roger (Parson)
on Aug 17, 2005 at 12:46 UTC ( #484402=note: print w/replies, xml ) Need Help??


in reply to Re^2: Loop will not save into the array
in thread Loop will not save into the array

Use $website_links[0][0] instead of $website_links[0]. Why? Because $website_links[0] is an array reference.

Hang on, better still, you just need to change one line of code to make it work...

From
my @website_links = $webcrawler->links;
to
my @website_links = map { $_->[0] } $webcrawler->links;

Cheers

Replies are listed 'Best First'.
Re^4: Loop will not save into the array
by lampros21_7 (Scribe) on Aug 17, 2005 at 13:51 UTC
    Hi Roger, it still doesn't work. I have changed it to

     my @website_links = map { $_-> [0] } $webcrawler->links; and then in the while loop

    @links = map { $_-> [0] } $webcrawler->links($new_uri[0]); but it still gives the same error. Sorry about this! I havent mentioned that am using ActivePerl 5.8.7 Build 813 if this is going to get rid of some headaches. Thanks for the help.Lambros

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://484402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2022-11-29 21:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?