#!/usr/bin/perl
#-#############################################
# catalog.pl
# Version: 1.05
# Date: 04/26/2004
#-#############################################
# Copyright (C) 2002 Dieter Werner
# http://www.interwer.com
# [EMAIL=hdw@interwer.com]hdw@interwer.com[/EMAIL]
#-#############################################
print "Content-type: text/html\n\n";
use strict;
use warnings;
#-#############################################
my $categories = [
['Telekommunikation',
['Festnetz',
['Telefon',
['Foo', 'Bar'],
],
['Telefax',
['Foo', 'Bar'],
],
],
['Mobilnetz',
['Handy used',
['Siemens',
['C25', 'C35', 'Other'],
],
['Nokia',
['5130', '7710', '8810', 'Other'],
],
['Panasonic',
['GD90', 'GD91', 'GD92'],
],
],
['Handy unused',
['Siemens',
['C25', 'C35', 'Other'],
],
['Nokia',
['5130', '7710', '8810', 'Other'],
],
['Panasonic',
['GD90', 'GD91', 'GD92'],
],
],
],
],
['Computer',
['Hardware',
['Monitor',
['Eizo',
['15 Zoll', '17 Zoll', '19 Zoll', '20 Zoll'],
],
['Other',
['15 Zoll', '17 Zoll', '19 Zoll', '20 Zoll'],
],
],
['CPU',
['Intel',
['up to 300 MHz', 'up to 600 MHz', 'up to 900 MHz'],
],
['AMD',
['up to 300 MHz', 'up to 600 MHz', 'up to 900 MHz'],
],
['Other',
['up to 300 MHz', 'up to 600 MHz', 'up to 900 MHz'],
],
],
],
['Software',
['Operating Systems',
['Windows', 'Linux'],
],
['Applications',
['Office-Software', 'Internet-Software', 'Games'],
],
],
],
];
#-#############################################
# Test:
# Convert array to hash
# and print the list of categories ...
#-#############################################
my $catalog = {};
dump_cat($_, $categories->[$_], $catalog) for 0 .. 1;
print "$_ => $catalog->{$_}
" foreach sort keys %$catalog;
print "