
BillKSmith
Veteran
Dec 23, 2012, 12:12 PM
Views: 2780
|
|
Re: [gevni] How to store unknown Array into Hash?
|
|
|
No loop is needed, use an array slice.
use strict; use warnings; my @join_array = ([qw(AA BB CC DD)]); my @tmp = (2, 1, 0, 3); my @array_index = @{$join_array[0]}[@tmp]; print "@array_index\n"; OUTPUT Edit: Added output Good Luck, Bill
(This post was edited by BillKSmith on Dec 24, 2012, 7:25 AM)
|