my @emails = (split(/\s*,\s*/, $email))[0..2]; #### my @emails = split(/\s*,\s*/, $email); if (@emails > 3) { ... warn ... } # Keep only the first three. splice(@emails, 3); #### $email = join(', ', (split(/\s*,\s*/, $email))[0..2]);
## my @emails = split(/\s*,\s*/, $email); if (@emails > 3) { ... warn ... } # Keep only the first three. splice(@emails, 3); ##
## $email = join(', ', (split(/\s*,\s*/, $email))[0..2]);