Take a look at this code:
#!/usr/bin/perl
use 5.008;
$_ = "somename@address.com";
if(/\@\w+\.com/)
{
print "\n\nmight be an email address\n\n";
}
else
{
print "\n\nnot an email address\n\n";
}
Shouldn't the /\@\w+\.com/ evaluate as true? I've also tried:
- /@\w+\.com/
- /.*\@\w+\.com/
- /.*@\w+\.com/
- /@/
- /\@/
I'm just not understanding what this wouldn't work. Can anyone shed any light on this?