Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
<?xml version ="1.0"?> <customer-data> <customer> <first_name>Frank</first_name> <last_name>Sanbeans</last_name> <dob>3/10</dob> <email>frank@example.com</email> </customer> <customer> <first_name>Sandy</first_name> <last_name>Sanbeans</last_name> <dob>6/12</dob> <email>sandy@example.com</email> </customer> </customer-data>
#!/usr/bin/perl use strict; use XML::Simple; my $xml = XMLin('parsetest.xml',forcearray => 1); foreach my $customer(@{$xml->{customer}}){ print "Name: $customer->{first_name}->[0]"; print "$customer->{last_name}->[0]\n"; print "Birthday: $customer->{dob}->[0]\n"; print "Email-add: $customer->{email}->[0]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to send parsed data to server
by LanX (Saint) on May 19, 2014 at 15:43 UTC | |
|
Re: how to send parsed data to server
by Anonymous Monk on May 19, 2014 at 15:56 UTC | |
|
Re: how to send parsed data to server
by locked_user sundialsvc4 (Abbot) on May 19, 2014 at 18:07 UTC | |
|
Re: how to send parsed data to server
by Anonymous Monk on May 19, 2014 at 16:02 UTC | |
|
Re: how to send parsed data to server
by Anonymous Monk on May 19, 2014 at 19:20 UTC | |
by Anonymous Monk on May 20, 2014 at 01:22 UTC |