Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Can I do this?

by synapse0 (Pilgrim)
on Jul 14, 2001 at 06:13 UTC ( [id://96652]=note: print w/replies, xml ) Need Help??


in reply to Can I do this?

My guess would be that another loop would start and $i would initialize to $j again.. But i haven't played with BLOCK: type structs before. Really, instead of asking, you should throw some prints in there and test it out, then ask question if the results puzzle you.. no amount of ppl telling you what will happen will take the place of the experience of experimentation...
$j=23; $x = 0; LABEL: for ($i=$j; $i<=$#array; $i++) { print "top of loop: \$i = $i\n"; print "interation $x\n"; $x++; if ($array[$i] eq "blah") { print "\$i is blah\n"; last LABEL; } elsif ($i == $#array) { print "\$i == $#array\n"; $i = 0; next LABEL; } else { next LABEL; } }
-Syn0

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-28 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found