in reply to I/O redirection

<STDIN> is a function that reads in a line. So you are throwing away a line each time you go through the loop. Try this untested code:

while ( 1 ) { if ( scalar(<STDIN>) =~ m'<script'i ) { while ( 1 ) { $line = <STDIN>; exit if ($line =~ m'</script'i); print $line; }}}

That's so ugly... I get a headache looking at it. You'll have better luck looking at the module HTML::Parser.

____________________
Jeremy
I didn't believe in evil until I dated it.

Replies are listed 'Best First'.
Re: Re: I/O redirection
by Anonymous Monk on Jun 03, 2002 at 02:09 UTC
    Thank you very much for sugestion. I will try. I realy beginner in this. Deki
Re: Re: I/O redirection
by Anonymous Monk on Jun 03, 2002 at 02:37 UTC
    If you are still on this page I would like to ask you to help me to retrive as well script tags and everything what is between these tags. And also I have one more JavaScript bloks. P.S. I have to be onest I started to read Perl 2 days ago. I had problem to set up path on my win 98 because I had problem wiht autoexec.bat file. How I can see you so good in this and If you have time help me . This is my assignment for tomorrow. What you gave to me. Working perrfect!!! Thank you very mach.
      Sorry, this sort of stuff is really boring, which is why I use someone elses module to do it.

      A step in the right direction for you would be to write some code so that when you get a line with a SCRIPT tag in it you break up the line at the SCRIPT tag. Commands like split will help a lot.

      You aren't making friends with me by asking me to do your assignment for you. If I do your assignments, will you give me your degree?

      ____________________
      Jeremy
      I didn't believe in evil until I dated it.