split bug? sure not, but...?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • frapan

    split bug? sure not, but...?

    do u know why

    print "\n a)", scalar split /:/, ':';
    print "\n b)", scalar split /:/, ':f';
    print "\n c)", scalar split /:/, ':f:';

    writes:

    a)0
    b)2
    c)2

    and not

    a)1
    b)2
    c)2

    as i expected?
    ok for trailing fields (perlfunc says they are deleted so b an c give
    same result), but shouldnt perl find an empty leading field splitting
    ':' ?

    thanks
Working...