Front page | perl.beginners |
Postings from December 2002
This perl script does nothing....
Thread Next
From:
Jonathan Daniels
Date:
December 6, 2002 16:33
Subject:
This perl script does nothing....
Message ID:
BA16ABBB.1E0%jdaniels@geo-centers.com
Hi,
Hopefully this isn't too stupid of a question. Thanks in advance for any
help.
Can anyone tell me why, when I feed a file of the following format
Date,Time,Action,Result,Client,Server,From,To,To,To,...,Subject,Size,SMTPID
20021128,9,Message Accepted,,10.0.0.1,,user@domain.com,use@no.com,...
This type of line many more times....
To the following script it does nothing. Nothing at all. No errors, just
returns to the command prompt.
#!/usr/bin/perl
while (<>){
chomp;
if (/^.*\@/g){ # find the first @ remember where it is.
if (/\G(domain)/i){ #go back and look for domain
print ; #if you find domain print the line.
}
}
else{
print "No Match.\n";
}
}
Thanks,
Jonathan
Thread Next
-
This perl script does nothing....
by Jonathan Daniels