On 8/2/05, Dave Gray <[EMAIL PROTECTED]> wrote:
> On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > yes but the problem is my start point and end point have identical entries
> > under them.  It is stopping at original1.1 when I need for it to stop at
> > the end of original1.1 and print
> >
> > media: sf
> >  Volumes:
> >    STK000
> >  Total space available:   60.8G
> >
> > as opposed to just allsets to original1.1
> 
> Here's a test program that demonstrates how to do that.
> 
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> while (<DATA>) {
>     if (/AA/ ... /(CC)/) {
>         print;
>         if ($1) {
>             while (<DATA>) {
> # this regex defines when your section is done
>                 last if /^\s*$/;
>                 print;
>             }

# so you don't have to spin over the rest of the file
last;

>         }
>     }
> }
> 
> __DATA__
> AA
> 
> BB
> 
> CC
> DD
> EE
> 
> FF
> GG
> 
> HH
> II
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to