in reply to Help with loops

hello,

if such addresses are undef they will be processed, being undef a possibility; it's up to you to check if is valid for you.

Notice also to add use strict; use warnings; in your programs.

As useful design pattern, put exit conditions as soon as possible:

foreach my $address (@email) { next unless $address; .. # or something more evoluted: unless (my_validate_mail_add($address)){ warn "'$address' is not a valid address"; next; } .. }

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Help with loops
by htmanning (Friar) on May 05, 2016 at 08:43 UTC
    Thanks. Your first suggestion worked.