in reply to Parsing xml:lang attribute
It's not the best way to solve the problem, and it's definitely not the shortest way to write it, but it works and makes sense (to me anyway)open R, "file" or die "could not open file\n"; while (<R>) { my @lines = split (/\n/); foreach my $line (@lines){ next if $line !~ /xml:lang/xg; my ($junk, $lang) = split /=/, $line; $lang =~ s/^"(.*)">$/$1/; print "$lang \n"; } }
|
|---|