in reply to updating Input file

use strict; my $stdInfo="stdInfo"; print " Enter the number of student that you want to delete\n"; my $std = <STDIN>; chomp $std; #open file and read it into an array... open(FILE, "$stdInfo") || die "couldn't open $stdInfo\n"; my @filedata = <FILE>; close (FILE); #open file for writing... open(FILE, ">$stdInfo") || die "couldn't open $stdInfo\n"; foreach my $line (@filedata) { print FILE $line unless ($line =~ /^$std/); } close (FILE);
If you are doing anything like this to a large file consider using a database or tieed file.


-Waswas