#!/usr/bin/perl -w print "Content-type: text/html\n\n"; use CGI::Carp qw(fatalsToBrowser); opendir(DIR, "."); @files = grep( /\.tmp/, readdir(DIR) ); @files = sort(@files); closedir(DIR); foreach $file(@files){ $found = 0; open(FOO, "$file") or die "Cannot open. $!\n"; while (<FOO>){ print "Copying table from $file...<br>"; if ( $_ =~ m/<!--TABLE -->/ig){ $found = 1; } if ($found == 1){ open(FILE,">>filename2.txt") or die "Cannot open. $!\n"; print FILE $_; close(FILE); } if ( $_ =~ m/<!--\/TABLE -->/ig){ $found = 0; } } close FOO; }
In reply to Re: Copying text between markers
by katgirl
in thread Copying text between markers
by katgirl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |