Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: XML::Twig and the monasteries XML (updated)

by LanX (Saint)
on May 30, 2019 at 23:31 UTC ( [id://11100756]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::Twig and the monasteries XML
in thread XML::Twig and the monasteries XML

Thanks, defining an input_filter did the trick °

$twig=XML::Twig->new( #discard_spaces => 1, input_filter => sub { $_[0] =~ s/^\n//r }, );

Also found discard_spaces but couldn't make it work though.

updated

or rather not !

I checked all calls to the callback, and the input filter is run on each line of input.

I.e. it will also discard newlines in the middle of a content.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2026-02-14 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.