"Sureshkumar M (HCL Financial Services)" schreef:
> #/usr/bin/perl
> open(DATA,"a1")||die"Unable 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 $in_fh, "<", $in_name
or die "Error with '$in_name': $!";
while ( <$in_fh> ) {
print if /\b\d{2}-(?:\d{2}|\w{3})-\d{1,4}/;
}
}
__END__
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/