John;

  Thank you very much for the help...works like a charm...now I'll try
to study it carefully to understand how to use this the next time I need
something like this...

Cool...

Ken Wolcott

On Tue, 2004-08-03 at 20:20, John W. Krahn wrote:
> Ken Wolcott wrote:
> > Hi;
> 
> Hello,
> 
> >   I need to find Makefiles that contain a backslash line continuation
> > character followed by a blank (or whitespace only) line.  I tried a
> > regular expression first but just couldn't get it right.  I then tried
> > comparing by a pair of strings, but that isn't right either.
> > 
> > [snip code]
> 
> This will do what you want:
> 
> #!/usr/bin/perl
> use strict;
> use diagnostics;
> 
> while ( <> ) {
>      my $line_num = $.;
>      if ( /\\\s*$/ ) {
>          my $line_before;
>          if ( ( $line_before = <> ) =~ /^\s*$/ ) {
>              print "$ARGV has a backslash continuation to a following blank line at 
> line $line_num\n";
>              }
>          else {
>              $_ = $line_before;
>              redo;
>              }
>          }
>      }
> 
> __END__
> 
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment


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