my @tag_regexes = map { qr/<($_) ?[^>]*>/ } qw/kt bold ital ch\d/; while (defined (my $line = <DATA>)) { die "Invalid element in line #$. ($line). Cannot proceed due to th +e above error\n" unless grep { $line =~ $_ } @tag_regexes; } __DATA__ <kt> <bold> <ital> <ch1> <kt someattribute="somevalue"> <bold someattribute="somevalue"> <ital someattribute="somevalue"> <ch1 someattribute="somevalue"> <foo>
In reply to Re^2: Matching elements in a array
by duckyd
in thread Matching elements in a array
by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |