in reply to Keeping separate array data related
If I understand your question, maybe you should use a hash of arrays.
use Data::Dumper; my %data; foreach my $index ( 0 .. $#texts ) { push @{$data{ $images[ $index ] }}, $texts[ $index ]; } print Dumper \%data;
Now you've got a hash where the keys are the various images, and the values are one or more texts, held in anonymous arrays. Dumper will show you what you've got here. If you still need to preserve order, keep the original images array around as the sorted list of keys.
Dave
|
|---|