#!/usr/bin/perl -w use strict; my @blacklist = qw ( server1 server2 server3 server5 ); my %blacklisted = map { $_ => 1 } @blacklist; my @candidate = <DATA>; chomp @candidate; my @servers = grep { not $blacklisted{$_} } @candidate; print "@servers"; __DATA__ server2 server5 server7 server8
In reply to Re: compare array with file
by brx
in thread compare array with file
by cinil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |