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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.