in reply to problem with deleting a row

G'day brianMonk,

Welcome to the monastery.

Here's another way to do it. While this is a working script, it's really just skeleton code. You may want to add feedback about whether the supplied username was found as well as a confirmation of the deletion.

#!/usr/bin/env perl use strict; use warnings; use autodie; my ($user_file, $changed_file) = qw{test.txt test.txt.mod}; open my $in_fh, '<', $user_file; open my $out_fh, '>', $changed_file; print 'Enter user to delete: '; chomp(my $user = <>); while (<$in_fh>) { print $out_fh $_ unless /^\Q$user\E,/; } close $in_fh; close $out_fh; rename $changed_file, $user_file;

-- Ken