The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/perl -w
use strict;
die "Usage: $0 <file>\n" unless @ARGV;
my $xml;
{
local $/=undef;
$xml=<>;
}
my $parser=new SVG::Parser(-debug=>1,'--indent'=>' ');
my $svg=$parser->parse($xml);
print $svg->xmlify();