Myself I don't think I have ever used split without the two slashes, though it strikes me that if you use a scalar as a split pattern without putting it into slashes like
split($pat, $stringtosplit); then I'm not sure what you'll get out of it. My guess would be it will be like using slashes, since perl tries to Do What You Mean sometimes.
Anyway the perldoc says,
As a special case, specifying a PATTERN of space (' ') will split on white space just as split with no arguments does. Thus, split(' ') can be used to emulate awk's default behavior, whereas split(/ /) will give you as many null initial fields as there are leading spaces. A split on /\s+/ is like a split(' ') except that any leading whitespace produces a null first field. A split with no arguments really does a split(' ', $_) internally.
In reply to Re: Split ( ) is Giving Me a Splitting Headache
by mattr
in thread Split ( ) is Giving Me a Splitting Headache
by HughBris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |