You missed some parentheses
#!/usr/bin/perl
use strict;
use warnings;
open(DATA, '', data) || dieUnable to open the file;
while(DATA) {
#if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/) {
if(/(\d{2}-(\d{2})|(\w{3})-\d{1,4})/) {
print;
}
}
close(DATA);
exit 0;
On
-20009
15-10-2008
(C)/tmp/d$
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
David Schmidt
Sent: Saturday, November 29, 2008 3:12 PM
To: Sureshkumar M (HCL Financial Services); beginners@perl.org
Subject: Re: date format search insdie
Hi all ,
Can someone help me on this
From: Sureshkumar M (HCL Financial Services)
Sent: Saturday, November 29, 2008 4:21 PM
To: 'David Schmidt'
Cc: beginners@perl.org
Subject: RE: date format search insdie the files
Hi David,
Thanks
Sureshkumar M (HCL Financial Services) schreef:
#/usr/bin/perl
open(DATA,a1)||dieUnable to open the file;
while(DATA)
{
if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/)
{
print $_;
}
}
close(DATA);
exit 0;
#!/usr/bin/perl
use strict;
use warnings;
my $in_name = data.in;
{ open my
5:30 PM
To: beginners@perl.org
Subject: Re: date format search insdie the files
Sureshkumar M (HCL Financial Services) schreef:
#/usr/bin/perl
open(DATA,a1)||dieUnable to open the file;
while(DATA)
{
if($_=~/\d{2}-(\d{2}|\w{3})-\d{1,4}/)
{
print $_;
}
}
close(DATA);
exit 0;
#!/usr
Sureshkumar M (HCL Financial Services) schreef:
Can you explain me this part how it's works?
(?:\d{2}|\w{3})
?: what this will do?
Read perlre (and find out what (?:) means).
And also, the output is like below
(C)/tmp/d$ perl 1
10-11-81
20-NOV-2008
05-07-1981
15-110-2008
Sureshkumar M (HCL Financial Services) schreef:
Can someone help me on this
Impossible.
--
Affijn, Ruud
Gewoon is een tijger.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/