develooper Front page | perl.beginners | Postings from September 2009

Re: push and split

Thread Previous | Thread Next
From:
Chas. Owens
Date:
September 19, 2009 10:12
Subject:
Re: push and split
Message ID:
58ce48dc0909191011u4ca2b575g3f9312840f30047f@mail.gmail.com
On Fri, Sep 18, 2009 at 22:06, Dr.Ruud <rvtol+usenet@isolution.nl> wrote:
> Noah Garrett Wallach wrote:
>
>> I am attempting to read a text file in to two array variables.
>>
>> --- text file ---
>> hostname1 ip1
>> hostname2 ip2
>>
>> --- text file ---
>>
>>
>> so basically I would like to have the items in column become an the
>> elements of an array @routers
>>
>> and then the items in column two in an array variable of @ips
>>
>> I suppose I could use split and push to do that but how?
>
> Parallel arrays are bad, use an AoA.
snip

An Aardvark of Action?  No, those are best used for signal processing.
 Oh, wait, you mean an [Array of Arrays][1].

[1] : http://perldoc.perl.org/perldsc.html#ARRAYS-OF-ARRAYS

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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About