(my $e=index($_,"|"))>0 and $current{substr($_,0,$e)}=$_ while ; ... if((my $e=index($_,"|"))>0 and exists $current{substr($_,0,$e)) {