Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 contemplating the Monastery: (None)
    As of 2024-04-25 01:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found