#!/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;