in reply to problem with deleting a row

#!/usr/bin/env perl use strict; use warnings; use Text::CSV; use Data::Dumper; my $file="test.txt"; my $csv = Text::CSV->new({binary => 1,allow_whitespace => 1}); open my $fh, "<:encoding(utf8)", $file or die "Could not open $file: $ +!\n"; my @rows; while (my $row = $csv->getline($fh)) { push @rows,$row; } my $user_to_delete = shift; if ($user_to_delete) { @rows = grep { $_->[0] !~ /$user_to_delete/ } @rows; print Dumper @rows; } else { die "No user entered\n"; }

Hi BrianMonk,

If you will be parsing CSV files, using Text::CSV is a good idea. It handles fields where there may be a comma in the data and other good things I'm sure.