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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl script to check the mail ids in the correct format or not
# 1  
Old 08-12-2012
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.
# 2  
Old 08-13-2012
What's wrong with Email::Valid module?
# 3  
Old 08-14-2012
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

Code:
 
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.

# 4  
Old 08-14-2012
Perl :error in Image::Grab module while installing

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

Thanks in advance...

Regards,
Giridhar
# 5  
Old 08-14-2012
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check user entered correct file format or not?

Hi Experts, path=/db/files/ format=$1 User can enter any file format.compare the user file format with actual file format existed in the directory /db/files. User enter all characters as "A" apart from date format. example1: user will be entering the file format AAA_AA_YYYYMMDD.AAA Actual... (6 Replies)
Discussion started by: nalu
6 Replies

2. Shell Programming and Scripting

Display calendar in correct format using shell script

Hi All, I'm trying to print calendar using shell script and i'm able to print it. But the format is not good. Here is the script. #!/bin/bash echo $(date) echo "Hello $USER" echo Hostname $(hostname) echo Working in $(pwd) echo Here is this month calender echo $(cal) $ sh first.sh... (7 Replies)
Discussion started by: chandrakanth
7 Replies

3. Shell Programming and Scripting

Output not in correct format - cd script

I have a script that looks like this: dirname2=/usr/tmp/filelist/*/* for dirname2 in /tmp/filelist/*/*; do (cd $dirname2/catalog ||echo "file does not exist" && echo "$dirname2" |cut -d '/' -f 7,8 && echo $i && ls -la |awk 'NR>3 {SUM += $5} END { print "Total number of kb " SUM }');done... (2 Replies)
Discussion started by: newbie2010
2 Replies

4. Shell Programming and Scripting

How to check if date format is correct?

Hi! how do i know if the input is the same as the required date format? the date should be dd/mm/YYYY ex. 2/3/2012 or 15/11/2012 all the following conditions must return an error: *input of string *day is > 31 or < 1 *month is > 12 or < 1 *year is < 2013 suppose the date format is stored... (1 Reply)
Discussion started by: angilulu
1 Replies

5. Shell Programming and Scripting

PERL : hhmiss - Date format check and replace

I have a filename, This can be any of any format, I want to check if the filename has hours,mins and seconds part. If it is present, i want to replace it with a " * " (star symbol) output needed: IMP: The time part can be in any pattern. How can this be done?:confused:... (3 Replies)
Discussion started by: irudayaraj
3 Replies

6. Shell Programming and Scripting

Check my script and correct the find command if wrong

Hello All, Here I am trying to find all the directories whose name starts with EFS or HOTFIX like in below example and below is my code but I don’t know why this is not working correctly. drwxr-xr-x 3 qabuild denccefs 4096 Sep 23 21:36 EFS110929A_SOURCE/ -rwxrwxr-x 1 qabuild... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

7. Shell Programming and Scripting

how to get the correct alignment in a textfile to a mail using shell script?

Hi All, Can any one solve this prob. Im sending a textfile content as a mail body while sending a mail using shell script. But, that textfile content is a unic command output. So, in mail, im not getting the correct alignment as in textfile. What may be the reason behind this. Can... (1 Reply)
Discussion started by: suman_dba1
1 Replies

8. UNIX for Advanced & Expert Users

Script which can send file to diffrent mail ids.

Hi i am looking for the script which can send file to different mailids, please halp me out. Thanks in advance. (3 Replies)
Discussion started by: vpandey
3 Replies

9. Shell Programming and Scripting

Check for proper e mail id format

Hi, We run an application called meta which reads user information from database and updates in LDAP.For that we have some scripts to check the uniqueness of mail ids between the existing LDAP and Database.It works fine when people enter mail ids in proper format (xxx.yyy@abc.com) but if it... (2 Replies)
Discussion started by: prolay
2 Replies

10. Shell Programming and Scripting

Check for the correct date format in UNIx

Hi All, I am getting two input from User for Date from the command prompt when my script is executed . The date format i am taking is : DD-MM-YYYY so is there any method in Unix to validate the two input date. There might be many cases for these two date to be invalid.... (1 Reply)
Discussion started by: rawatds
1 Replies
Login or Register to Ask a Question