http://www.perlmonks.org?node_id=1012434


in reply to Hash Question

That's what variables were invented for

my $inp; print "What column do you want ? "; do { $inp= <>; chomp($inp); } until ($inp=~/^\d+$/ and $inp>=11 and $inp<=19); foreach (<$bh>) { my @text=split(/\t/); $bHash{$text[0]} = $text[$inp]; }

In this case the user is asked to type in a column number between 11 and 19