in reply to Seeking guidance on how to approach a task

Contrary to an earlier suggestion, I'd read "file 1" first, and store each "user*" string as a hash key -- there will be less data overall to keep in memory.

Then, reading "file 2", only print a line if its first token does not exist as a hash key. These are the records in file 2 that do not exist in file 1.

Put that way, the script can be very short, especially if you just give the file names as command line args:

use strict; die "Usage: $0 file.1 file.2\n" unless ( @ARGV == 2 ); # test for number of args my %known; open( F, "<", $ARGV[0] ) or die "$ARGV[0]: $!"; while (<F>) { chomp; $known{$_} = undef; # don't need a value, just the key } close F; open( F, "<", $ARGV[1] ) or die "$ARGV[1]: $!"; while (<F>) { my $key = ( split ' ', $_ )[0]; # get first "word" print unless exists( $known{$key} ); } close F;
That will print the targeted records to STDOUT, which you can redirect to a file via the command line:
little_perl_script.pl file.1 file.2 > target.set
(update: just noticed that this is identical to TedPride's suggestion, ignoring a few trivial, irrelevant differences. sorry about the redundancy)