in reply to file reading issues
my $file = '/path/to/file.txt'; open(IN,"<$file") || die $!; read IN, my $html, -s $file; close(IN); $html =~ s/<!-- Begin -->(.*?)<!-- End -->/$1/s;
my $flag = 0; while (<FILE>) { $flag = 1 if (/<!-- Begin -->/); $flag = 0 if (/<!-- End -->/); process_line($_) if ($flag); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: file reading issues
by JediWizard (Deacon) on Aug 03, 2005 at 19:19 UTC | |
by kwaping (Priest) on Aug 03, 2005 at 19:36 UTC | |
by JediWizard (Deacon) on Aug 04, 2005 at 02:57 UTC | |
by kwaping (Priest) on Aug 04, 2005 at 15:08 UTC | |
by JediWizard (Deacon) on Aug 04, 2005 at 16:49 UTC | |
by anonymized user 468275 (Curate) on Aug 04, 2005 at 16:13 UTC |