If you don't care how you get the results, then this works (if I read your problem statement correctly). It uses
List::Compare from CPAN.
#!usr/bin/perl
use strict;
use warnings;
use feature 'say';
use Data::Dumper::Simple;
use List::Compare;
my @dead_list = (100,
101,
103,
200,
201,
202,
203,
210,
211,
212,
220,
221,
222,
230,
231,
232,
233,
240,
241,
242,
243,
1000,
1001,
1002,
1010,
1011,
1012,
1020,
1021,
1022,
1120,
1121,
1122,
1210,
1211,
1212);
my @get_list = (
'100',
'200',
'210',
'220',
'230',
'240',
'1000',
'1001',
'1002',
'1120',
'1210',);
my $lc = List::Compare->new(\@dead_list, \@get_list);
my @result = $lc->get_unique;
say Dumper(@result);
__END__
@result = (
'101',
'1010',
'1011',
'1012',
'1020',
'1021',
'1022',
'103',
'1121',
'1122',
'1211',
'1212',
'201',
'202',
'203',
'211',
'212',
'221',
'222',
'231',
'232',
'233',
'241',
'242',
'243'
);
Cheers,
Brent
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.