split bug? sure not, but...?

F

frapan

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top