On Mon, May 08, 2006 at 07:07:14PM -0400, Mr. Shawn H. Corey wrote:
> On Mon, 2006-08-05 at 15:15 -0700, chen li wrote:
> > Both line codes work perfectly:
> > 
> > my @new_array = map { split } @arry;
> > or 
> > my @new_array = split ' ', "@arry";
> 
> The second statement will work perfectly if every element has only one
> space character separating its components and has no leading or trailing
> spaces. A more general case would be to to split on whitespace:
> 
>   my @new_array = split /\s+/, "@arry";
> 
> See `perldoc perlretut` and `perldoc perlre` for details.

Um, that's not quite correct.

See `perldoc -f split` for details.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to