in reply to How to validate file format
Hi,
Pls. also try out this
while(<DATA>) { my $a=''; next if $_=~m#^\s*$#; $val=0, $a=0 if $_=~m#<main>#; ++$val, $a=$1 if $_=~m#<sub([0-9])>#; print STDERR "Check the Order!! $a comes instead of $val\n" if ($a + != $val); } __DATA__ <main>Ability-oriented motivation, 00206.p0105 <main>Ability test <sub1>in conjunction with achievement batteries, 00226.p0085 <sub3>definition, 00226.g0005 <main>Aboriginal athletes, 00954.p0155 <sub2>Absolutism, 00688.p0010
Thanks,
Gopal.R
|
|---|