in reply to strip until blank line

assuming FILE as your handle
while(<FILE>) { last if (/^\s+$/); } # Begin processing
Whoops! First try would of just thrown away the first few lines. It works now thanks to quidity
Must learn to test.
And read the preview. Cut and paste got rid of the "\". Thanks dominus whose /\S/ solution would probably be quicker

Replies are listed 'Best First'.
Re: Re: strip until blank line
by Dominus (Parson) on Nov 23, 2000 at 01:19 UTC
    Says lemming:
    > last if (/^+s$/);
    >
    > Whoops! Must learn to test.
    I think you still need to learn to test. That line matches the strings "s", "s\n", and nothing else.

    Maybe you wanted last if /^\s*$/. But I would have written last unless /\S/ instead.

Re: Re: strip until blank line
by quidity (Pilgrim) on Nov 23, 2000 at 00:06 UTC

    Using next here will start the next iteration of the while loop. You want to use last instead. Hmmm, which you've now done. This post looks silly now.