>> <LabelResponse> >>> <Label> >>> <Image Number="1">base64datahere</Image> >>> <Image Number="2">base64datahere</Image> >>> <Image Number="3">base64datahere</Image> >>> </Label> >>> </LabelResponse> >>> >>> I need to be able to grab the correct set of base64 data. Does anyone >>> know how to do that? > > It's a common practice, to avoid using XML::Simple. It's also a common > practice not to give practical suggestions. Since you *did* ask for > XML::Simple, I went ahead and made a small example of how it would be > used in such a case. Now, keep in mind I don't know whether your XML > file is only what you pasted, or whether it is larger, or more complex > > #!/usr/bin/perl > > use strict; > use warnings; > use XML::Simple; > > my $data = XMLin($path_to_file); > > foreach my $image (@{$data->{Label}->{Image}}) { > print "$image->{content}\n"; > } > > Gives out > > base64datahere > base64datahere > base64datahere
Thanks Erez, I will stick with XML::Simple for now. I need to save each set of base64data to a separate variable, so I can save each to a separate file. How can I save each to a separate variable? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/