in reply to Re: Re: Re: Re: Help with Header stripping
in thread Help with Header stripping

Quit thinking about what the unwanted content looks like.

Concentrate on the empty lin that separates it from the wanted content. And regardless of what the wanted format is, the empty line is always there.

So you need to remove everything up to and including the empty line.

This is your homework now: figure out how to skip everything up to and including the blank line.

  • Comment on Re: Re: Re: Re: Re: Help with Header stripping

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Help with Header stripping
by Traku (Initiate) on Apr 03, 2004 at 04:16 UTC
    Alright, so I am now able to skip everything up to and including the line.. the problem is.. that it will write only write to the new file one line... Like the socket closed on me or something. Here is the snippet of code I am using to copy the file over.

    while($request = <$socket>)
    {
    if($request =~ /(\r\n\r\n)(.*)/)
    {
    print FILE1 $2;
    while($request = <$socket>) {
    print FILE1 $request;
    }
    }
    }