Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @account = qw( 96329XY 7776fc 334457yg 2233oop 000001 8877666b); my @file = qw(8877666b.txt 2233oop.txt 334457yg.txt 7776fc.txt 96329X +Y_K.txt); my %seen; for my $acc (@account) { next unless $acc =~ /^\d+/; my $key = $acc; push @{$seen{$key}}, $acc; } #print Dumper %seen; for my $filename (@file) { next unless $filename =~ /^\d+/; my $key = $filename; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Compare two arrays
by Eily (Monsignor) on Oct 01, 2014 at 16:38 UTC | |
by Anonymous Monk on Oct 01, 2014 at 17:14 UTC | |
by Eily (Monsignor) on Oct 01, 2014 at 17:25 UTC | |
by Anonymous Monk on Oct 01, 2014 at 17:57 UTC | |
by Eily (Monsignor) on Oct 01, 2014 at 22:26 UTC | |
|
Re: Compare two arrays
by Bloodnok (Vicar) on Oct 01, 2014 at 17:43 UTC | |
|
Re: Compare two arrays
by hippo (Archbishop) on Oct 01, 2014 at 22:45 UTC | |
|
Re: Compare two arrays
by mr_mischief (Monsignor) on Oct 01, 2014 at 17:56 UTC | |
|
Re: Compare two arrays
by karlgoethebier (Abbot) on Oct 01, 2014 at 18:59 UTC | |
|
Re: Compare two arrays
by thanos1983 (Parson) on Oct 02, 2014 at 15:09 UTC |