I’m trying to grab each word in the string that can be separated by various number of whitespaces.
my $ff = "Disk DSM Policy Paths Serials";
if($ff =~ m/(\w+)/) {
print $1;
print $2;
print $3;
}
I thought it would be as simple as \w but it only gets the first word? Am I doing something wrong?
You need to match
globally.A better solution is to split.