in reply to
String to tokens
Don't call your sub 'x'. That's the name of a
perl operator
.
You can use magical
split
to divide your text on whitespace:
sub words { split " ", $_[0]; }
[download]
That works by splitting the first argument given to the sub. In a more complex sub, I would have
shift
ed the first argument into a temporary variable.
After Compline,
Zaxo
Comment on
Re: String to tokens
Download
Code
In Section
Seekers of Perl Wisdom