my $str = "Helloooo, nurse!" my ($greeting, $recipient) = $str =~ m/^(\w+),\s+(\w+)/; print "Greeting: '$greeting', Recipient: '$recipient'\n";