Prasanthi Tenneti wrote:
> 
> hi,
> how to remove a line from a file?
> pls help me.

press the delete key repetedly? :)

but really, i think you'll need to give som more info. what line? first
line, last line, random line, line nbr n?

would this be it?

my $line_to_delete = 7;
open (F, 'some_file');
my @file_content = <F>;
close (F);
open (F, '>same_file');
for (0..$#file_content)
{
   next if $_ == $line_to_delete;
   print F $file_content[$_];
}
close (F);

/jon

ps check the docs with perldoc perl, www.perl.org and so on, read about
files... 



> thank you.
> prasanthi.
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to