sub get_items { my $category = shift; open(DATAFILE,"$catagory.dat") or return undef; my @fields = qw/time name email phone subject data passwd picture priceline/; my @items = (); while () { chomp; my %hash = (); @hash{@fields} = split /=/, $_; push @items, \%hash; } return @items; } #### print $items[$i]{time}; print "There are " . scalar(@items) . " items\n"; # etc..