while () { next if ( /^{/ ); ## we only need to check the first character. #Grab 9999991234 from line above my $MIN = ( split /,/ )[1]; ## we only need to assign one variable $minhash{$MIN} = undef; }