in reply to Difference Quantity of two Arrays
sub create_list { my @skip_dbs = @_; # declare the hash my %skippables; # populate the hash with the skippables foreach my $skip_db (@skip_dbs) { $skippables{$skip_db} = 1; } my @dbs = qw/fetch forward user smtp/; # create a list of each element of @dbs # that isn't in the skippables hash my @good_dbs; foreach my $db (@dbs) { unless (exists $skippables{$db}) { push @good_dbs, $db } } return @good_dbs; } my @list = create_list("user", "smtp"); print "@list";
|
|---|