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

Re: find the element position of $scalar

by    (Sexton)
on Feb 08, 2002 at 08:50 UTC ( [id://144066]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $i=0;
    foreach $scalar(@array) {
       print("$scalar is $i element\n");
       $i++;
       }
    
  2. or download this
    my $i=0;
    for(@array) {
       print("$_ is $i element\n");
       $i++;
       }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found