Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: XML::Simple forcearray problem

by erasei (Pilgrim)
on Aug 07, 2003 at 20:08 UTC ( #282017=note: print w/replies, xml ) Need Help??


in reply to XML::Simple forcearray problem

the 'XMLin' function doesn't take a file handle, but rather the file name as argument. From the perldoc:
my $ref = XMLin([xml file or string>], [, <options>]);
Try this instead:
my $config = XMLin("someFile.DTD", forcearray => 1);
In your code, you XMLin $FILE, but you don't declare $FILE in your code submitted. What I expect is happening is that you are trying to XMLin '$FILE' (the undeclared variable) thinking it is 'FILE' (the file handle). By XMLin'ing '$FILE' (which is empty) you are calling XMLin without all of the required arguments, thus throwing the error message mentioned.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2018-08-18 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (186 votes). Check out past polls.

    Notices?