Smaug has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use XML::Simple; &Getsettings; sub Getsettings { if (my $config = XMLin("xmlin.xml",ForceArray => 1)) { my $value1 = $config->{'value1'}->[0]; my $value2 = $config->{'value2'}->[0]; my $value3 = $config->{'value3'}->[0]; print "The values of 1, 2 and 3 are: $value1 $value2 $value3\n +"; } else { print "Config file not found"; } }
As stated it runs fine as a .pl but gives the error: "Can't use string ("1") as an ARRAY ref while "strict refs" in use at PERL2EXE_STORAGE/XML/Simple.pm line 231."<XML> <value1>1</value1> <value2>2</value2> <value3>3</value3> <value4>4</value4> </XML>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple error in compiled script
by Anonymous Monk on Mar 02, 2005 at 15:40 UTC | |
by Smaug (Pilgrim) on Mar 03, 2005 at 08:05 UTC | |
|
Re: XML::Simple error in compiled script
by Scrat (Monk) on Sep 10, 2007 at 13:43 UTC | |
by Smaug (Pilgrim) on Sep 10, 2007 at 14:16 UTC | |
|
Re: XML::Simple error in compiled script
by Anonymous Monk on Jan 30, 2008 at 09:47 UTC |