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

Re: for loop is skipped for not so obvious reason (false)

by Anonymous Monk
on Feb 06, 2013 at 11:41 UTC ( #1017391=note: print w/ replies, xml ) Need Help??


in reply to for loop is skipped for not so obvious reason

so $lb and $la are printed just before the for loop, but not within.

Seeing how $la and $lb variables, the reason the loop is skipped is because $i <= $lb evaluates to false


Comment on Re: for loop is skipped for not so obvious reason (false)
Re^2: for loop is skipped for not so obvious reason (false)
by Anonymous Monk on Feb 06, 2013 at 11:42 UTC
    $ perl -E " my($la,$lb)=@ARGV; for ( my$i= $la; $i < $lb; $i++){ say $ +i; } " $ perl -E " my($la,$lb)=@ARGV; for ( my$i= $la; $i < $lb; $i++){ say $ +i; } " 0 0 $ perl -E " my($la,$lb)=@ARGV; for ( my$i= $la; $i < $lb; $i++){ say $ +i; } " 1 0 $ perl -E " my($la,$lb)=@ARGV; for ( my$i= $la; $i < $lb; $i++){ say $ +i; } " 0 1 0

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-07-03 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls