Bennco99 has asked for the wisdom of the Perl Monks concerning the following question:
Thank youuse Tie::File; use warnings; my $file_name = 'G:\FF\myfantasyfootball.txt'; print "Enter the player's name that was drafted:"; my $player_drafted = <STDIN>; chomp $player_drafted; print "Player is: '$player_drafted' \n"; # open the file with tie tie my @file_lines, 'Tie::File', $file_name or die; # filter out lines containing from user input @file_lines = grep { !/$player_drafted/i } @file_lines; #print @file_lines; # close the file with untie. # IMPORTANT: always untie when you are done! untie @file_lines or die "$!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I verify what line(s) were found and deleted from a file
by dogz007 (Scribe) on Aug 16, 2007 at 22:43 UTC | |
by Bennco99 (Acolyte) on Aug 17, 2007 at 03:01 UTC |