in reply to Parsing xml:lang attribute

Well, I'm sure there's an elegant way to do it with the Module, which you should look into and definitely use, but if you just want to get the language value in a $lang variable, there's a lot of ways to do that:
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"; } }
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)