Sadmachine has asked for the wisdom of the Perl Monks concerning the following question:

I'm reading each line of a file and when I find a specific line I want to delete that line from the file without leaving a blank line in the file.

Anyone know how to do this?

Sadmachine

Replies are listed 'Best First'.
Re: Deleting lines from files
by azatoth (Curate) on Jun 05, 2001 at 17:30 UTC
Re: Deleting lines from files
by petdance (Parson) on Jun 05, 2001 at 17:31 UTC
    The Perl FAQ knows all. The searchbox here at the Monastery does, too.

    xoxo,
    Andy

    %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
    'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
    "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >