#!C:\PERL\bin\perl.exe
use strict;
use CGI ':standard';
use XML::Simple;
#Variables
my $var;
my $var1;
my $var2;
$var = 'kool';
$var1 = 'max';
$var2 = "800.55.01";
print header;
my @data = ('C:\Program Files\Apache Group\Apache2\htdocs\legastronome\XML\Admin\coffee.xml');
my $xml = XMLin((join'', @data));
foreach my $sub (@{$xml->{'subcategory'}})
{
foreach my $product (@{$sub->{'product'}})
{
foreach my $prod_id (@{$sub->{'prod_id'}})
{
if ($prod_id eq $var2)
{
$prod_id = '800';
#Testing variables :)
print "
";
print "";
print "Test
";
print "Done
";
print "
";
print "
Close this window ";
print "";
}
else
{
#Testing variables :)
print "";
print "";
print "Test
";
print "Fail!!!
";
print "
";
print "
Close this window ";
print "";
}
}
}
}
===DATA===
150 years of know how at the service of a same strategy: Taste
images/bag_legal.jpg
Roaster since 1851, Café Legal has a perfect knowledge of the green coffee market.
A revolution in the packaging arena, Café Legal is at the origin of a major break through on the coffee market.
Prestige is a very traditional French recipe: a blend of Robusta and Arabica beans. The Robusta is known for its strength and the Arabica for its delicate flavour.
images/prestige.jpg
Coffee
D
A
800.55.01
Legal
Legal Prestige
250
12
/recipes/coffee1.html