as part of my assignment i'm trying to validate an email address stored in an hash, with the key: 'email' and the value as the data supplied. But the email is not getting validated using reg-ex:

if($form_element{'email'} =~ m/^[A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{2,4}$/i){
        $values = 0;
        $mail = "InValid!";
} else {
        $mail = "Valid!";
}
if($form_element{'email'} =~ m/^[a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-]+([.][a-zA-Z0-9_\-]+)+[a-zA-Z]{2,4}$/i){
        $values = 0;
        $mail = "Valid!";
} else {
        $mail = "InValid!";
}
commented: Excellently answered!! +1