#my code: #this fails since two Gilligan keys exist use warnings; use strict; open( DATA, 'data' ) or die "i cannot read data:$!\n"; my %hash; while () { my ( $name, $item ) = split(/:/); $hash{$name} = $item; for my $name ( keys %hash ) { my $lc_name = lc $name; open( FILE, ">$lc_name.info" ) or die "cannot open FILE:$!\n"; print FILE "$name $hash{$name}"; } }