#!/usr/bin/perl -w use strict; my %TEST; my @fileData; dbmopen(%TEST, "mydata", 0777) || die "couldn't open the dbm"; open(TEST, "test2.txt") || die "Could not open the file for reading: $!"; while () { chomp; my ($key,@fileData) = split /\|/; $TEST{$key} = \@fileData; } close(TEST); print "$TEST{matthew20}->[1]";