in reply to comparing two arrays
use strict; my @report = qw(sqltable mike_test sarak_mike); my @file = qw(some other stuff mike_test sarak_mike); my %in_file = map{$_ =>1} @file; my $all_match = 1; foreach (@report) { if (! exists $in_file{$_}) { $all_match = 0; print "\@report value: '$_' is not in \@file.\n"; } } print "All values in \@report found in \@file\n" if $all_match;
--Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: comparing two arrays
by jdelmedi (Initiate) on Nov 25, 2001 at 21:29 UTC | |
by jlongino (Parson) on Nov 25, 2001 at 22:12 UTC | |
by jdelmedi (Initiate) on Nov 26, 2001 at 18:03 UTC | |
by jlongino (Parson) on Nov 26, 2001 at 20:48 UTC | |
|
Re: Re: comparing two arrays
by jdelmedi (Initiate) on Nov 25, 2001 at 01:26 UTC | |
by mattr (Curate) on Nov 25, 2001 at 12:56 UTC | |
by jdelmedi (Initiate) on Nov 25, 2001 at 21:12 UTC |