Just another Perl shrine | |
PerlMonks |
Re: Re: Re: packing/unpacking/split/join confusionby pfaut (Priest) |
on Jan 01, 2003 at 17:13 UTC ( [id://223593]=note: print w/replies, xml ) | Need Help?? |
The first argument to split is a regex that describes the delimiters in the second argument. By specifying a space, you are telling split to break the string apart wherever it sees a space. So, split ' ',"A B C D" returns ('A','B','C','D'). If instead of space there were commas in your string, you could split ',',"A,B,C,D" instead. This would produce the same result.
In Section
Seekers of Perl Wisdom
|
|