in reply to Until there's nothing but spaces?
opendir (ID, "$dir"); @dirlist = readdir(ID); closedir(ID); foreach $inode (@dirlist) { $i++; print "Files processed: $i\n"; next if $inode =~ /^\./; my $sfile = $dir . $inode; open (IF, "<$sfile"); @fcont = (<IF>); close (IF); open (OF, ">$sfile"); foreach $line (@fcont) { if ($line =~ /themark/) { print "starter string found\n"; $flag = 1; next; } if ($flag == 1) { if (!($line =~ /\w+/)) { $flag = 0; next; } else { print OF $line; } } } close (OF); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Until there's nothing but spaces?
by mandog (Curate) on Oct 01, 2001 at 06:40 UTC | |
by grinder (Bishop) on Oct 01, 2001 at 17:16 UTC | |
by mandog (Curate) on Oct 02, 2001 at 04:51 UTC |