my ( $index ) = split /\|/, $str; $data_hash{$index} = $str; #### my ( $index, @rest ) = split /\|/, $str; $data_hash{$index} = join '|', @rest;