Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
... for (my $i = 0; $i < @{$mydata}; $i++) { $account_number = $mydata->[$i]{'account_number'} || ''; $name = $mydata->[$i]{'name'} || ''; $email = $mydata->[$i]{'email'} || ''; if($email eq '') { bad_email("No email address found '$account_number'."); next; # <------ here } elsif ($email !~ /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i ) { $msg = "Invalid email address - '$email' on account '$account_nu +mber'."; bad_email($msg); next; # <------ here } elsif (($name eq '') || ($account_number eq '')) { $msg = "Missing information: Number = '$account_number', Name = +'$name'."; next; # <------ here } else { # Send emails send_email( send my stuff here); my $data = "<tr><td align=\"left\">".$account_number."</td><td>" +.$email."</td></tr>"; push @all_data, $data; } $sql = "update table set date = '$datetime' where number = '$accou +nt_number' and date = '$mydata->[$i]{'date'}'"; exec_single_sql($sql, $db) || die "Unable to update table"; } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Next in IF statement question!
by Corion (Patriarch) on Nov 16, 2010 at 16:55 UTC | |
|
Re: Next in IF statement question!
by bobr (Monk) on Nov 16, 2010 at 18:16 UTC | |
by pemungkah (Priest) on Nov 17, 2010 at 00:04 UTC | |
|
Re: Next in IF statement question!
by GrandFather (Saint) on Nov 17, 2010 at 03:16 UTC | |
|
Re: Next in IF statement question!
by anonymized user 468275 (Curate) on Nov 16, 2010 at 17:22 UTC |