vishnu.prasad has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: XML processing help!
by afoken (Chancellor) on Sep 24, 2010 at 04:17 UTC

    Perlmonks is not a code writing service. Show us what you tried so far. Using an XML parser is highly recommended.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: XML processing help!
by suhailck (Friar) on Sep 24, 2010 at 05:19 UTC
    Try XML::Simple

    Also, check your uploaded XML file for syntax errors
Re: XML processing help!
by murugu (Curate) on Sep 24, 2010 at 08:02 UTC
    Try XML::Parser

    Regards,
    Murugesan Kandasamy
    use perl for(;;);

Re: XML processing help!
by Jenda (Abbot) on Sep 24, 2010 at 19:32 UTC

    This is not a very well designed XML! And there's a missing / in the last tag.

    use strict; use XML::Rules; my $parser = XML::Rules->new( stripspaces => 7, rules => { _default => 'as is', name => 'content', command => 'content', value => sub { my ($tag,$attr,$context,$parents) = @_; my $name = $parents->[-1]{name}; my $value = $attr->{_content}; return '%values' => {$name => $value}; } } ); my $data = $parser->parse(\*DATA); use Data::Dumper; print Dumper($data); __DATA__ <test_config> <action_1> <command>cmd</command> ...

    Take this as the start and DO READ THE DOCS.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.