Skip Menu |

This queue is for tickets about the Weather-Com CPAN distribution.

Report information
The Basics
Id: 56562
Status: new
Priority: 0/
Queue: Weather-Com

Owner: Nobody in particular
Requestors: ruprich [...]

Bug Information
Severity: Wishlist
Broken in: 0.5.5
Fixed in: (no value)

Subject: No value specified for 'ForceArray' option in call to XMLin() when used from mod_perl
Download (untitled) / with headers
text/plain 800b
Linux 2.6.18-128.el5 #1 SMP x86_64 x86_64 x86_64 GNU/Linux CentOS release 5.3 (Final) perl v5.8.8 mod_perl-2.0.4-6.el5 perl -MWeather::Com::Base -e 'print $Weather::Com::Base::VERSION;' 1.009 perl -MXML::Simple -e 'print $XML::Simple::VERSION;' 2.18 When i try to search with Weather::Com from the line, everything goes all right. But when i use it from mod_perl, XML::Simple runs in STRICT MODE (i don't understand where/why this happens, but it does), it croaks No value specified for 'ForceArray' option in call to XMLin() at /usr/lib/perl5/site_perl/5.8.8/Weather/Com/ line 230 I saw, that you've already added the ForceArray option to get_weather method, so would it be possible to add it also to the search method? My suggestion is in the attached patchfile. Thanks for your time.
Subject: WeatherComBase.patch
--- /usr/lib/perl5/site_perl/5.8.8/Weather/Com/ 2010-04-12 15:41:04.000000000 +0200 +++ /usr/lib/perl5/site_perl/5.8.8/Weather/Com/ 2010-04-12 17:12:13.000000000 +0200 @@ -227,7 +227,12 @@ return 0 unless ( $locationXML =~ /^\<\?xml/ ); # parse answer - my $simpleHash = XMLin($locationXML); + my %options = ( + ForceArray => [ qw(loc content id) ], + KeyAttr => { 'loc' => 'content', 'loc' => 'id' } + ); + + my $simpleHash = XMLin($locationXML, %options); # XML::Simple behaves differently when one location is return than # when more locations are returned ...

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to