Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: C-Style Struct?

by Anonymous Monk
on Aug 08, 2012 at 14:00 UTC ( [id://986285]=note: print w/replies, xml ) Need Help??


in reply to Re: C-Style Struct?
in thread C-Style Struct?

just like in c/c++, its the 124th element of that array

See

see perlintro, Data Type: Array, References quick reference

Also, click the link marked "reply" to respond directly to a post , otherwise you're talking to yourself :)(sometimes that is ok)

Replies are listed 'Best First'.
Re^3: C-Style Struct?
by Mr. Newb (Acolyte) on Aug 08, 2012 at 14:06 UTC
    My self has few answers, that's why I come here. How would I iterate through the array $thing{list}? ie, what would I write for a foreach loop?
      How would I iterate through the array $thing{list}? ie, what would I write for a foreach loop?

      my %thing = ( name => 'fred', count => 100, list => [ 1..10 ] ); print $thing{ list }[ 3 ]; 4 for my $item ( @{ $thing{ list } } ) { print $item; } 1 2 3 4 5 6 7 8 9 10 for( my $index=0; $index < @{ $thing{ list } }; ++$index ) { print "$index : $thing{ list }[ $index ]"; } 0 : 1 1 : 2 2 : 3 3 : 4 4 : 5 5 : 6 6 : 7 7 : 8 8 : 9 9 : 10 print for @{ $thing{ list } }; 1 2 3 4 5 6 7 8 9 10

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-24 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found