$string = 'keep|throw'; my( $keep ) = split( /\|/, $string) ; print $keep; #### keep