# shlomi-fish-homepage / bin / find_ascii_quotes.pl

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 #!/usr/bin/perl use strict; use warnings; use XML::LibXML; use XML::LibXML::Reader; use XML::LibXML::XPathContext; use Getopt::Long; my $out_fn; binmode STDOUT, ":utf8"; # Input the filename foreach my$filename (@ARGV) { my $reader = XML::LibXML::Reader->new( location =>$filename, load_ext_dtd => 1, 'no_network' => 1, ) or die "Cannot read '$filename'."; while ($reader->read()) { if ($reader->nodeType() == XML_TEXT_NODE) { my$data = $reader->value; my @lines = split(/\n/,$data, -1); foreach my $idx (0 ..$#lines) { my $line =$lines[$idx]; if ($line =~ m{"}) { printf {*STDOUT} ("%s:%d:%s\n", $filename,$reader->lineNumber()+$idx,$line ); } } } } }