Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > split bug? sure not, but...?

Reply
Thread Tools

split bug? sure not, but...?

 
 
frapan
Guest
Posts: n/a
 
      09-21-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a split is not a split Dumbell Computer Support 3 03-09-2009 10:45 PM
sure shot requirement for C++ with Unix Experience !!! sure interviewto day !!! Himayat66@gmail.com ASP .Net 0 02-07-2008 12:40 AM
How can I split database results with ExecuteReader and Split? needin4mation@gmail.com ASP .Net 2 05-05-2006 10:36 PM
split on '' (and another for split -1) trans. (T. Onoma) Ruby 10 12-28-2004 06:36 AM
Small inconsistency between string.split and "".split Carlos Ribeiro Python 11 09-17-2004 05:57 PM



Advertisments