Evil hack that only works for single-character splits that are otherwise well-behaved (i.e. no trailing spaces, in this case):
print ++($string =~ tr / //);
Side note: with perl 5.6, I get "implicit split to @_ deprecated" with the scalar trick outlined above if I run under -w (and I do, oh yes, I do!)
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: different return type for split
by arturo
in thread different return type for split
by t0j0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |