I'm working on a project with a few other classmates where we're taking user input to form an xml, then turning it into a list using html. I'm fairly new to the class and having a bit of trouble. Here's what I have so far:
#!/usr/bin/perl use warnings; use strict; use lib '****'; use wishlist::globals; use wishlist::functions; # prompt for input information; print "Give the item a pretty name: "; chomp (my $name = <>); print "Now describe it and what about it makes you smile: "; chomp (my $desc = <>); print "How much does it cost? Not in rupees or credits,in U\$D!"; chomp (my $price = <>); print "Give me a link to click on later! Make sure it works! "; chomp (my $link = <>); print "You want this exact thingiemabobber? (TF)"; chomp (my $spec = <>); if ($spec eq "T" or $spec eq "t"){ $spec = 1; } elsif ($spec eq "F" or $spec eq "f"){ $spec = 0; } else { print "Invalid entry. You are being blonde! Go back to start!\n"; exit; } use XML::Simple qw (:strict); use Data::Dumper; my $filename = 'wishlist.xml'; my $xml = new XML::Simple; my $data = $xml->XMLin($filename, ForceArray => 1, KeyAttr => {'item'}, KeepRoot => 1, ); $data = $xml->XMLout; # output data updateXML ($name, $desc, $price, $link, $spec, $XMLFILE); # exit program exit;
Any help would be greatly appreciated!

In reply to Help using XML Simple by thenoobiest

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.