On Apr 24, Adam Moskowitz said: >In the following program, I contend that split() should return the same >number of fields in both cases: > > my $str1 = "aaa:bbb:ccc:ddd:eee"; > my $str2 = "aaa:bbb:ccc:ddd:"; > @w = split(/:/, $str1); > @w = split(/:/, $str2); >It doesn't. I'm pretty sure that this is neither the correct nor >expected behavior. split /PATTERN/,EXPR,LIMIT split /PATTERN/,EXPR split /PATTERN/ split Splits a string into an array of strings, and returns it. By default, empty leading fields are preserved, and empty trailing ones are deleted. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve japhy@pobox.com http://www.pobox.com/~japhy/ http://pinyaj.stu.rpi.edu/ PerlMonth - An Online Perl Magazine http://www.perlmonth.com/ The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/Thread Previous