$authentication .= $authentiction. $1. " "; #### $authentication .= $authentication. $1. " "; #### while ($str =~/authentication ?(\S+)?/g){ $authentication .= $authentiction. $1. " "; #more perlish } #### $authentication = join " ", $str =~ /authentication ?(\S+)?/g; #even more perlish