From: Grant M. <gr...@us...> - 2006-10-05 08:28:10
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7623/lib/XML Modified Files: Simple.pm Log Message: - added test for bad GroupTags option Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Simple.pm 3 Oct 2006 01:07:48 -0000 1.28 +++ Simple.pm 5 Oct 2006 08:28:05 -0000 1.29 @@ -791,8 +791,14 @@ # make sure there's nothing weird in {grouptags} - if($opt->{grouptags} and !UNIVERSAL::isa($opt->{grouptags}, 'HASH')) { - croak "Illegal value for 'GroupTags' option - expected a hashref"; + if($opt->{grouptags}) { + croak "Illegal value for 'GroupTags' option - expected a hashref" + unless UNIVERSAL::isa($opt->{grouptags}, 'HASH'); + + while(my($key, $val) = each %{$opt->{grouptags}}) { + next if $key ne $val; + croak "Bad value in GroupTags: '$key' => '$val'"; + } } |