Hello all...

I'm wanting to write a script that scans a file,
ignoring all lines until it reaches a certain
section, then processes all lines in that
section that are not comments, until it reaches
the end of that section.

The section would be designated like this:

## Beging Processing ##

## End Processing ##

So I open my file, and skip all lines until I
see that first bit...  Then do stuff until I
see the last bit.  Can someone help me out with 
this?

Tony


#!/usr/bin/perl -w

use strict;

open (FILE, "<myfile")
          or die "Could not open Template. ($!)";

while ($line = <FILE>) {
        #skip until beginning....

        #End when "End Processing" is reached
        last if $line =~ "End Processing";

        #Process the lines in between
        next if $line =~ /^#/;
        #do stuff....
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to