m[^ ( [^|]+ ) \| ]x and $current{ $1 } = $_ while ; ... if( m[^ ( [^|]+ ) \| ]x and exists $current{ $1 } ) { #### (my $e=index($_,"|"))>0 and $current{substr($_,0,$e)}=$_ while ; ... if((my $e=index($_,"|"))>0 and exists $current{substr($_,0,$e)) {