in reply to creating an array name using information from another array

To put the earlier replies together, something like this might be close to what you want (not tested):
my %xref_hash; for my $dev ( @dev_list ) { print STDOUT "looking for $dev\n"; for my $x ( @xref ) { if ( $x =~ /$dev\./i ) { my $hkey = "dev_xref_$dev"; push @{ $xref_hash{ $hkey }}, $x; } } } # to use that data structure: for my $hkey ( keys %xref_hash ) # (you might want to sort) { print join( "\n ", "\nvalues for $hkey:", @{$xref_hash{$hkey}} ), +"\n"; }

Replies are listed 'Best First'.
Re: Re: creating an array name using information from another array
by Balls McWang (Novice) on Mar 05, 2004 at 15:02 UTC
    Thanks to all for the help

    Realised last night that I was trying to make it too complex and ended up doing something a lot easier. I got my head caught up around the concept that I needed what I thought were "annoymous references" when there was a much easier way to do it.

    I'm looking forward to reading the nodes you have all posted for me to look at ... and to learning more Perl