#in scalar context: my @words =(); push @words, $1 while $word =~ /(\w+'?)/g; #in list context: my @words = ( $word =~ /(\w+'?)/g );