in reply to Re: Get out of "For Loop"!
in thread Get out of "For Loop"!

There's no reason to separate the error check from the error message in this code.
for my $item (@$data) { if (!defined($item->{email}) || $item->{email} eq '') { bad("No email address."); next; } good("Email found."); ...other stuff... }

Replies are listed 'Best First'.
Re^3: Get out of "For Loop"!
by roboticus (Chancellor) on Oct 12, 2010 at 21:12 UTC
      Your code is correct, just structurally more complicated than it needed to be.