sub foo { my $str = shift; my @text = $str =~ /(\S+)/g; ... } # call as foo("This is a test"); [download]
In reply to Re: String to tokens by Roger in thread String to tokens by nulloverflow