Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Undefined Array Reference

by syphilis (Archbishop)
on Apr 22, 2009 at 23:42 UTC ( [id://759437]=note: print w/replies, xml ) Need Help??


in reply to Undefined Array Reference

In your for loop, $ref_b->[$i] doesn't exist for $i greater than 2. Consequently, as soon as $i == 3, you get the error you see.

What do you want to push onto @{$ref_a->[$i]} when $i is 3, 4 or 5 ?

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Undefined Array Reference
by ikegami (Patriarch) on Apr 22, 2009 at 23:54 UTC
    Maybe nothing?
    | v for my $i (0..$#$ref_b) { push @{$ref_a->[$i]}, @{$ref_b->[$i]}; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found