Output :use Modern::Perl; my $str = qq@ <note> <to> <person>Satan</person> </to> <from via="postcard" russia="with love">moneypenny</from> <heading></heading> <body></body> </note>@; $str =~ s@<(.*?)></\1>@@g; say $str;
No modules or parsing needed, just a simple one line regex.<note> <to> <person>Satan</person> </to> <from via="postcard" russia="with love">moneypenny</from> </note>
In reply to Re: prune xml of empty elements
by Logicus
in thread prune xml of empty elements
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |