Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Re: @a[0] vs $a[0]

Reply
Thread Tools

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

 
 
ixtahdoom
Guest
Posts: n/a
 
      09-10-2003
> > $ 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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments