On Thu, 9 Mar 2006, Wayne Kelly wrote: > I'm having trouble understanding the logic behind the semantics of the > break construct, specifically when used in lamdbas and methods. I'm also having that trouble. It's something that is much easier to understand in Perl5, as there is no Proc/Block/Method difference and lambdas always work the same and so do breaks. sub myiterator { my($list,$proc)=@_; for my $i (@$list) { $proc->($i) } } sub func { my($x)=@_; print "$x\n"; last; print "after\n" } my $lambda = sub { my($x)=@_; print "$x\n"; last; print "after\n" }; myiterator([1..10],sub {my($x)=@_; print "$x\n"; last; print "after\n"}); myiterator([1..10],$lambda); myiterator([1..10],\&func); ------------------8<--------cut-here--------8<------------------ prints this: 1 1 1 perl is so easy. sometimes. _ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tñÍ:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, MontrñÂl QC Canada