in reply to Re: No xml module please
in thread No xml module please

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Re: Re: No xml module please
by DamnDirtyApe (Curate) on Jul 18, 2002 at 16:41 UTC
    however, once your script is do in 1 hour

    All the more reason to use the right tools.

    #! /usr/bin/perl use strict ; use warnings ; use XML::Simple ; use Data::Dumper ; my $xml = qq{ <message><file>D:\linkctltr.cxx</file><line>68</line><type>Note</t +ype> <codee>970</codee><desc>Use outside of a typedef</desc></message> } ; my $data = XMLin( $xml ) ; print Dumper( $data ) ;

    _______________
    D a m n D i r t y A p e
    Home Node | Email
Re: Re: Re: No xml module please
by mirod (Canon) on Jul 18, 2002 at 16:43 UTC

    Will it take you an hour to write this?

    #!/usr/bin/perl -w use strict; use XML::Simple; use Data::Dumper; my $file= shift @ARGV; my $xml= XMLin( $file); print Dumper( $xml);

    From there the XML is loaded in a Perl structure in memory, you know what that structure is and you can start working on the interesting part of the code, not on the XML plumming.

    How long did it take you to write regexp based code that does not parse XML? How long did it take you to post a question on PerlMonks and to wait for an answer?

    Above all do you want code that uses a module and that works or code that does not?

    --
    The Error Message is GOD - MJD