Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: perl xml parsing

by marto (Bishop)
on May 25, 2012 at 14:49 UTC ( #972449=note: print w/ replies, xml ) Need Help??


in reply to Re^2: perl xml parsing
in thread perl xml parsing

From the command line run this:

perl -MXML::SAX -e "XML::SAX->add_parser('XML::SAX::PurePerl')->save_p +arsers()"

Also consider adding the following lines to your code:

use strict; use warnings;

See Use strict and warnings.


Comment on Re^3: perl xml parsing
Select or Download Code
Re^4: perl xml parsing
by poper12 (Initiate) on May 25, 2012 at 14:56 UTC

    no luck.. Is there anything else i can change inside the code to get the xml data stored in the txt?

      "no luck.. Is there anything else i can change inside the code to get the xml data stored in the txt?"

      What happened when you tried? You didn't get the warning you mention here. See How do I post a question effectively?.

      #!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("news2Obama.xml"); open (FH , '>', 'new_output.txt') or die "can't open file: $!"; my $fh_o = Dumper ($data); print FH $fh_o; close FH or die "can't close file:$!";

        i keep getting this message: could not find ParserDetails.ini in C:/Perl/site/lib/XML/SAX

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-03 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls