See provided code examples.
i.e. you need to terminate with explicit next statements to avoid fall through.
for ($var){ if (/abc/) { print "abc"} # falls through if (/def/) { print "def" ;next} if (/xyz/) { print "xyz" ;next} print "default"; }
Cheers Rolf
( addicted to the Perl Programming Language)
In reply to Re^5: perldelta unclear on 'given's fate
by LanX
in thread perldelta unclear on 'given's fate
by morelenmir
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |