Re: @a[0] vs $a[0]

Discussion in 'Perl' started by ixtahdoom, Sep 10, 2003.

  1. ixtahdoom

    ixtahdoom Guest

    > > $ a thing
    > > @ means thingies you can get by using numbers
    > > % thingies you can get by keys (which kan be numbers, strings etc)
    > >
    > > So if you want a thing out of a thingies you use $ and not @ (thingies)
    > > nor % (thingies)
    > >

    >
    > however, as a comparison for the %a{foo}, similarly to doing @a[0,5,9] to
    > get an array slice, you can do @a{item1, item5, item9} to get a slice from a
    > hash.


    Whoa! That example just blew my mind. Now it is perfectly clear. Thanks!
    ixtahdoom, Sep 10, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page