Free2Code
 
Time: 2008-12-04, 09:03pm
Too much information for $1?
Subject: Too much information for $1?  ·  Posted: 2006-03-30, 01:54am
Rank: ? (1)
Member #: 27071
I am writing a program that deletes the text between a start point and an end point. This is off a webpage, so the line I am aiming for is extremly long. I wrote the code:

Code:
  1. @ARGV=$dir.$htmlFile;
  2. $^I=".bk";
  3. while (<>) {
  4.       m/$clipStart(.*?)$clipEnd/;
  5.     $inBetween = $1;
  6.     
  7.     if ($inBetween)
  8.     {
  9.         s/$inBetween//;
  10.     }
  11.         print;    
  12. }
  13. }


This works fine when what is returned in $1 isn't too big. But one file where there is a lot of text between $clipStart and $clipEnd, $1 doesn't seem to get all of it. Is there a workaround for this?

» Post edited 2006-03-30, 01:55am by Slock.

 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons