On Tue, 05 Oct 2004 22:46:58 -0400, Randy W. Sims
<[EMAIL PROTECTED]> wrote:
> On 10/5/2004 10:36 PM, Randy W. Sims wrote:
> 
> > while (defined( my $line = <INPUT> )) {
> >     if ( /-+ pam_unix Begin -+/ .. /-+ pam_unix End -+/ ) {
> >         # between beginning and end
> >     }
> > }
> 
> err, that was obviously not tested. Should be:
> 
> while (defined( my $line = <DATA> )) {
>      if ( $line =~ /begin/ .. $line =~ /end/ ) {
>          # between beginning and end
>      }
> }
> 
> 

Thanks Randy!  With your help my brain has been jumpstarted and I've
put together the following.

my @tmp = split /\n/, $body;
                                                                                
        foreach my $t (@tmp) {
                                                                                
                if ( $t =~ /\-+\spam_unix\sBegin/ .. $t =~
/\-+\spam_unix\sEnd/ ) {
                        #push @lines, $t;
                        if ( $t =~ /\(([A-Za-z0-9\.\-]+)\s*\)\:/ ) {
                                print "<$1>\n";
                        }
                }
                                                                                
        }

Thanks again,
-- 
Kevin Old
[EMAIL PROTECTED]

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