Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Does your XML::Simple code pass the strict test?

by grantm (Parson)
on Dec 09, 2002 at 09:21 UTC ( #218480=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use XML::Simple qw(:strict);
    
  2. or download this
    use strict;
    use XML::Simple qw(:strict);
    ...
      print "$book->{title}\n";
      print "  $_\n" foreach(@{$book->{author}});
    }
    
  3. or download this
    No value specified for 'forcearray' option in call to XMLin() at ./str
    +icttest.pl line 26
    
  4. or download this
    my $library = XMLin($xml, forcearray => [ qw(book author) ]);
    
  5. or download this
    No value specified for 'keyattr' option in call to XMLin() at ./strict
    +test.pl line 26
    
  6. or download this
    my $library = XMLin($xml,
      forcearray => [ qw(book author) ],
    ...
    );
    
    print $library->{book}->{1565922204}->{title}, "\n";
    
  7. or download this
    my $library = XMLin($xml, forcearray => [ qw(book author) ], keyattr =
    +> [] );
    
  8. or download this
    Learning Perl, 3rd Edition
      Randal L. Schwartz
    ...
    Guitar for Dummies
      Mark Phillips
      John Chappell
    
  9. or download this
    my $library = XMLin($xml,
      forcearray => [ qw(author) ],
    ...
    );
    
    print $library->{book}->{1565922204}->{title}, "\n";
    
  10. or download this
    <book> set in keyattr but not in forcearray at ./stricttest.pl line 26
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://218480]
Approved by gjb
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-09-15 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls