in reply to help with lists

Smells a bit of homework, but I'll give you this one:
@ARGV = qw(file2); my %names_in_file2; while (<>) { my ($name) = split /\|/; $names_in_file2{$name}++; } @ARGV = qw(file1); $^I = ".bak"; # create backup file while (<>) { # in-place edit my ($name) = split /\|/; print unless $names_in_file2{$name}; }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: help with lists
by Anonymous Monk on Mar 27, 2004 at 22:58 UTC

    Now that's the way to answer questions you suspect as homework. Using a solution that nobody would generally use under normal circumstances. :)