Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: What is $x{$y}?

by Riales (Hermit)
on Sep 10, 2012 at 19:02 UTC ( #992826=note: print w/replies, xml ) Need Help??


in reply to What is $x{$y}?

It looks like you have a array @x of array refs, of which you want the array ref at index $y.

You have a hash %x of array refs, of which you want the array ref with key $y.

The @{ } that surrounds all of it means you're dereferencing the array ref at index $y and getting the array that the array ref points to.

Replies are listed 'Best First'.
Re^2: What is $x{$y}?
by dave_the_m (Prior) on Sep 10, 2012 at 19:12 UTC
    Or strictly speaking, a hash %x of array refs.

    Dave.

      Oops, you're right. Array is totally wrong. Making the change to the original post!
        How about $x{@y} then? How does that work?

        For instance, in a foreach $x(@y){} line of code.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992826]
help
Chatterbox?
[LanX]: auto-subtitles in YT are entertaining: "fuehrer" instead of fewer, "jews" instead of juice ...
Discipulus never noticed there was subtitles... can I call them with &subtitle or is too much perl 4?
[LanX]: YT=youtube
[Discipulus]: ;=) yes i'm not SO dumb
[LanX]: SO=StackOverflow
[Discipulus]: :=(

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-06-23 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (552 votes). Check out past polls.