splits the specified string by the specified pattern
"string" - the string to split
'pattern' - the pattern that defines substrings this string should be broken up by.
limit - limits the number of segments to split the sentence into.
a scalar array
@data = @("Raphael,Professional Escort,NY", "Frances,Sales Warrior,MI"); foreach $var (@data) { ($name, $job, $state) = split(',', $var); println("$name works as a $job in $state"); }
Raphael works as a Professional Escort in NY Frances works as a Sales Warrior in MI