ok I understand now...thanks, but I tried it and it is still stopping at
original1.1
I then modified it to print YESSSS if ($1) but never saw YESSSS in STDOUT.





                                                                           
             Dave Gray                                                     
             <[EMAIL PROTECTED]                                             
             om>                                                        To 
                                       beginners@perl.org                  
             08/02/2005 03:11                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: reg exp using \G                
             Please respond to                                             
                 Dave Gray                                                 
             <[EMAIL PROTECTED]                                             
                    om>                                                    
                                                                           
                                                                           




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>





-- 
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