Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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?
[Corion]: marto: Oof - that means taking a day off or can you work from home?
[marto]: Corion, I can do some non-technical things, but there's no way for me to connect to the clients network.
[marto]: which is a shame, I had a really productive day yesterday
[Corion]: marto: Meh, so it'll be a day of cleaning out email...
[marto]: and hoped that I'd be able to continue the momentum :)
[marto]: I can't even access client email, nor my employers since those idiots moved to citrix
[marto]: it literally doesn't work. Also, via their citrix interface theres no way to open attachments, or upload an attachment for sending. The company policy is that you email you work account from a personal one, and forward it on from there :/

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-01-16 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (175 votes). Check out past polls.

    Notices?