#!/usr/bin/perl use strict; use warnings; use diagnostics; if (@ARGV = 2){ my %delList; open my $BEEPON, '>>', "./beepon.file"; open my $BEEPOFF, '>>', "./beepoff.file"; open my $LISTDEL, '<', $ARGV[0]; foreach (<$LISTDEL>){ chomp($_); $delList{$_} = 1; } open (my $ORGLIST, '<', $ARGV[1]); foreach my $entry (<$ORGLIST>){ chomp($entry); print { exists $delList{$entry} ? $BEEPON : $BEEPOFF } $entry . "\n"; } close $LISTDEL; close $BEEPON; close $BEEPOFF; }