Steve Bertrand wrote:
Noah Garrett Wallach wrote:
Hi there,

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?

What have you tried?

After you've read the following, post back here with what you've tried,
and with any further questions:

perldoc -f split
perldoc -f push

Also, if you are trying to do what I think you are doing, you may want
to look at using a hash instead:

$router_hash{ hostname1 } = 'ip_addr';

Steve
okay I will got the Hash route - thanks


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to