Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Learning Perl - Question About Using a For Loop To Pull Data From an Array

by tangent (Parson)
on Apr 01, 2016 at 22:06 UTC ( [id://1159341]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @names  = qw / fred betty barnet dino wilma pebbles bam-bam /;
    
    ...
        my $index = $counter - 1;
        print "\t$counter - 1 = $index: $names[ $index ]\n";
    }
    
  2. or download this
    number of elements in array: 7
    index number of first element: 0
    ...
        1 - 1 = 0: fred
    counter is: 3
        3 - 1 = 2: barnet
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-25 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found