my $temp = "Firstword and then the rest of the string"; $temp =~ /^(\w+)([ \w]*)/i; my $firstword = $1; my $restofstring = $2;