in reply to Looking for smart solution

XML::LibXML, XML::LibXML::Node, XML::LibXML::Attr, XML::LibXML::Element, et cetera. There's a lot to read, read it.

use strict; use warnings; use XML::LibXML; my $file = shift || die "Give me your XML file\n"; my $doc = XML::LibXML->new->parse_file($file); # Do your processing. It's not hard if you read the docs thoroughly. $doc->toFile($file);

Replies are listed 'Best First'.
Re^2: Looking for smart solution
by Sun751 (Beadle) on Jun 23, 2009 at 08:57 UTC
    Thanks for recommandation and suggestion, problem is at my work place server where I suppose to run this script unfortunately those modules are not installed and I don't have the right to do that. If You guys have any suggestion regarding above code please!!! Cheers!

      local::lib solves the install problem nattily. If you have libxml installed on your box, you'll be able to install XML::LibXML fine. If not, I think XML::Twig is pure perl and has a nice perly interface to XML. Parsing XML by hand is an error prone royal pain and few here would do it for themselves let alone for a third-party. :)