| Server IP : 217.160.0.244 / Your IP : 216.73.216.157 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /kunden/proc/self/root/usr/share/doc/libxml-sax-expat-perl/examples/ |
Upload File : |
#!/usr/bin/perl -w
use strict;
use warnings;
use XML::SAX::Expat;
sub Counter::new { bless { count => 0 }, shift }
sub Counter::start_element { shift->{count}++ }
if (@ARGV != 1) {
print "Usage: $0 example.xml\n";
exit;
}
my $counter = Counter->new;
my $parser = XML::SAX::Expat->new(Handler => $counter);
$parser->parse_file($ARGV[0]);
printf "%s has %d elements\n", $ARGV[0], $counter->{count};