Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • The answer perl is giving you seems to be right to me. If you try split( /:/, "a:b::c" ) you get a 4-element result with the third being the null string, ("a", "b", "", "c"). For a single element result, split( /:/, "ab" ) returns the single element "ab", split( /:/, "a" ) returns the single element "a", and split( /:/, "" ) returns the single element "". Returning 0 elements for the last case would be inconsistant with the previous set of results.