On Sat, Mar 15, 2008 at 6:14 PM, John Sampson
<[EMAIL PROTECTED]> wrote:
> Hello -
>
>  I am trying to accumulate items in a flat list (array) by
>  concatenating on to it
>  the scalars contained in arrays which in turn are contained in arrays. The 
> data
>  is to be read in from a file rather than existing as literals in my code.
>
>  Everything I try either crashes the computer or gives me an array of
>  arrays instead
>  of a flat list.
>
>  I have been programming in Unicon which has a concatenate operator, but Perl
>  makes very heavy weather of nested list management. Should I switch to Lisp,
>  or is there a way of doing what I want to do in Perl?
>
>  Regards
>
>  _John Sampson_
snip

Um, I am uncertain what you are trying to do, can you provide the data
you are reading in and what form you want it to have?  It sounds like
you want the push function:

my @array;
while (<>) {
    push @array, split;
}


-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

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


Reply via email to