"Mumia W." schreef: > Hien Le: >> [...] >> # Method 2 >> print( "\nMethod 2\n" ); >> my @bar2 = split( /([a-z]{5})/, $foo ); # Captures white-spaces >> ?!? [...] > > The comments made by Dr. Ruud and John W. Krahn are correct. > Split is returning the empty strings between delimiter > segments in the original string. To zap these out, do this: > > my @bar2 = grep length, split (/([a-z]{5})/, $foo); > > Any substrings with a length of zero will be removed by "grep > length."
Huh? Why not just remove the capturing "()"? Again: perldoc -f split -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>