use strict; use CGI ':standard'; use XML::Simple; use Data::Dumper; #Variables my $newval = 'Max'; my $categor = 'Vinegars'; my $oldval = 'Martin Pouret'; my $prodid = '600.54.01'; my $cats; if ($categor eq 'Coffee') { my $cat = (); } elsif ($categor eq 'Vinegars') { $cats = (); print "Hello world"; #exit 1; } elsif ($categor eq 'Seafood') { my $cat = (); } elsif ($categor eq 'Pate') { my $cat = (); } elsif ($categor eq 'Mustard') { my $cat = (); } else { print "Sorry the category that you wanted to edited doesn't exist. Please contact your administrator. \n Thanks"; print "No data will be print"; exit 1; } my $cat = $cats; my $arrays = [qw/subcategory packaging_qty recipe description product paragraph comments channel brand conditionning product_id heading photo/]; my $category = XMLin($cat, keyattr => 1, forcearray => $arrays); print Dumper($category) #### ===DATA=== Gourmet vinegar for Connoisseurs. Vinegar as it was once and always should be! images/vinegars.jpg Vinegar D S 600.54.01 Martin Pouret Red wine vinegar old reserve 500 6