Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: XML::Simple forcearray problem

by csuhockey3 (Curate)
on Aug 15, 2003 at 16:25 UTC ( #284193=note: print w/replies, xml ) Need Help??


in reply to Re: XML::Simple forcearray problem
in thread XML::Simple forcearray problem

Hi Grant,

Sorry for the lag time, I have been ill. There is no bug to worry about, strict is indeed enabled. I tried to find some more answers in your XML FAQ (very nice by the way). It was informative, but I am still stranded.

I have tried all of the above suggestions, but still seem to be having difficulty. I have never been stuck on someting like this before. It can't be that difficult. please remember to be gentle, I am very new at perl. Thanks again, below is what I have, complete (I took the rest of the code out, leaving only the problem). Any more ideas as to what I am doing wrong?

#... use Data::Dumper; use XML::Simple; use XML::Simple qw(:strict); open(FILE, "someFile.DTD") or die "can't open file: $!"; my $config = XMLin("someFile.DTD", forcearray => 1); print Dumper($config);

Replies are listed 'Best First'.
Re: Re: Re: XML::Simple forcearray problem
by runrig (Abbot) on Aug 15, 2003 at 16:43 UTC
    From the XML::Simple docs on importing ':strict':
    the following common mistakes will be detected and treated as fatal errors: Failing to explicitly set the KeyAttr option - if you can't be bothered reading about this option, turn it off with: KeyAttr => [] ...

    It's not the forcearray that's giving you the problem, its the lack of KeyAttr.

    Also note that you don't need two 'use XML::Simple' lines. One is plenty.

      Thanks! Indeed, very helped me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284193]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2018-07-21 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (448 votes). Check out past polls.

    Notices?