http://qs321.pair.com?node_id=930188


in reply to array within an array

Your text description does not match your stated output, but I think you are looking for something like this...
use warnings; use strict; my @charges = qw/ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8 ch1 ch2 ch3 ch4 ch5 ch1 ch2 ch6 ch7 ch4 ch3 ch9 ch2 ch4/; my %bundle1 = map { $_ => 0 } qw(ch3 ch4 ch6); for (@charges) { if (exists $bundle1{$_}) { print "chx "; } else { print "$_ "; } } print "\n"; __END__ ch1 ch2 chx chx ch5 chx ch7 ch8 ch1 ch2 chx chx ch5 ch1 ch2 chx ch7 ch +x chx ch9 ch2 chx