On Mon, 2006-08-05 at 12:58 -0700, chen li wrote:
> Hi all,
> 
> I have an arry like this:
> 
> @arry=('AA bb','BB','CC AG')
> 
> How do I turn it into new array like this:
> 
> @new_array=('AA','bb','BB','CC','AG')

Do you mean to break the elements on whitespace?

my @new_array = map { split } @arry;


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/



-- 
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