split bug? sure not, but...?

Discussion in 'Perl' started by frapan, Sep 21, 2003.

  1. frapan

    frapan Guest

    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
    frapan, Sep 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    1
    Views:
    337
    Kevin Spencer
    Sep 25, 2005
  2. Keith G
    Replies:
    0
    Views:
    1,627
    Keith G
    Sep 8, 2003
  3. JAlexa9898
    Replies:
    2
    Views:
    412
    Andrew Thompson
    Feb 2, 2005
  4. Dundonald
    Replies:
    5
    Views:
    295
    Dundonald
    Nov 13, 2007
  5. Replies:
    0
    Views:
    540
Loading...

Share This Page