>>>>> "FL" == Federico Lucifredi <[EMAIL PROTECTED]> writes:
>> since @triggers must be the same length as @commands then use that fact:
>>
>> my @triggers = ('0') x @triggers ;
FL> that's a good idea -- that I actually recently used. in this case I left
FL> the list explicit b/c the triggers will not necessarily be always all of
FL> the same value.
and if you do the structure idea you don't need this either
>> i can't imagine ever doing a for loop on a flag. use flow control ops
>> (last/next/redo)
>>
FL> That won't cut it here -- I want to finish up the current row ( the
FL> inner ), and then terminate ( the outer ). last will only let me stop
FL> now.
i don't understand 'stop now'. last/next/redo can take a loop label so
you can choose which loop's flow you are controlling. in general with
perl and those flow control ops, you never need to loop over a flag. in
other langs it is about the only way to do it and i feel it is very
clunky style in perl.
>> if( $result == $trig ) {
>>
>> print ON_RED, $result, RESET, "\t" ;
>> last ;
>> }
>> else {
>> print $result, "\t" ;
>> }
>>
FL> I went with a variant of this one as it seems the most elegant option
FL> when having to retain setting the flag to terminate the outer loop. too
FL> bad there isn't a last-outer-when-done-inner kind of thing :D
there is. see my comments above.
uri
--
Uri Guttman ------ [EMAIL PROTECTED] -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm