perl script to check the mail ids in the correct format or not

Hi Folks,

I have few mailids in a text file and need to check whether the mailid is in correct format or not.

If just to check whether the string is a mailid or not there is a perl module Email::Valid to do the business or we can implement our own logic.

But the mail_ids I am having is like

stephen.albert@xyz.com
ram.kiran@xyz.com
george.fish@xyz.com

The syntax will be firstname.lastname@xyz.com

I am looking for a perl expression/code to check whether the email id is in the above format or not.

What's wrong with Email::Valid module?

thought that it is not possible but I had done that using Email::Valid module. thanks...

and I do have a doubt.. I use padre IDE for developing perl scripts and I install the modules based on requirement directly in padre IDE which is just a button click...

I was trying to install Image::Grab module but I am getting an error message( attached the command prompt error message and log file).

PSB error message while installing Image::Grab module

 
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.62)
Checking if you have LWP::UserAgent 0 ... Yes (6.03)
Checking if you have HTML::HeadParser 0 ... Yes (3.69)
Checking if you have Digest::MD5 2.07 ... Yes (2.51)
Checking if you have URI::URL 1 ... Yes (5.04)
Checking if you have HTML::TreeBuilder 0.51 ... Yes (4.2)
Checking if you have HTTP::Cookies 0 ... Yes (6.01)
Building and testing Image-Grab-v1.4.2
cp lib/Image/Grab.pm blib\lib\Image\Grab.pm
cp lib/Image/Grab.pod blib\lib\Image\Grab.pod
cp lib/Image/Grab/RequestAgent.pm blib\lib\Image\Grab\RequestAgent.pm
C:\Dwimperl\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
#   Failed test at t/background.t line 12.
# Looks like you failed 1 test of 1.
t/background.t ... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/comics.t ....... skipped: (no reason given)
t/cookies.t ...... skipped: (no reason given)
t/direct_grab.t .. ok
t/easy.t ......... ok
t/manpage.t ...... ok
t/md5.t .......... ok
t/type.t ......... ok
Test Summary Report
-------------------
t/background.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=8, Tests=12,  3 wallclock secs ( 0.08 usr +  0.06 sys =  0.14 CPU)
Result: FAIL
Failed 1/8 test programs. 1/12 subtests failed.
dmake.exe:  Error code 255, while making 'test_dynamic'
-> FAIL Installing C:\cpan_modules\Image-Grab-1.4.2.tar.gz failed. See \.cpanm\build.log for details.
Expiring 43 work directories.
 

Could you please check build.log (attached) and let me know what went wrong ?

Thanks in advance...

Regards,
Giridhar

It could be possible that padre IDE is not installing the modules that are a pre-requisite for Image::Grab module.

From the screenshot, I understand that you're working on windows. I presume you've installed the Activestate flavour of perl. If that be the case, Activestate perl also provides a "Perl Package Manager". Installing modules using Perl Package Manager is again, as you mentioned "just a button click". Plus it also installs all the pre-requisites.