catfish1116 has asked for the wisdom of the Perl Monks concerning the following question:
I got my script to parse out an XML message. However, I did receive a few error messages. Below is code and errors
my $line = <>; print "This is what line looks like $line \n"; #while ($line = !<>) { chomp($line); print "This is what line looks like $line \n"; my @items = (split /></, $line); printf "\n\n Item 1 $items[1], \n Item 2 $items[2], \n Item 3 $it +ems[3]\n"; # } Missing argument in printf at ./XML_parse line 19, <> line 1. Invalid conversion in printf: "%20R" at ./XML_parse line 19, <> line 1 +.
Also, how could I parse a file that has more than 2 messages? I.e. what would be the message delimiter? I have been 'asked' not to download the XML module on my workstation, so I am trying to be creative. :) TIA The Catfish
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML parsing
by choroba (Cardinal) on Dec 11, 2019 at 16:42 UTC | |
Re: XML parsing
by Fletch (Bishop) on Dec 11, 2019 at 17:12 UTC | |
Re: XML parsing
by haukex (Archbishop) on Dec 11, 2019 at 17:31 UTC | |
Re: XML parsing
by stevieb (Canon) on Dec 11, 2019 at 17:24 UTC | |
by hippo (Archbishop) on Dec 11, 2019 at 18:37 UTC | |
Re: XML parsing
by Jenda (Abbot) on Dec 12, 2019 at 13:00 UTC |