On Nov 22, 6:57 am, [EMAIL PROTECTED] (Avinashsuratkal)
wrote:
>
> In short I need to read the text between 2 lines, which can be
> incorporated in the perl script, but not a one-liner.
>
> Thanks,

If my interpretation of your needs is correct, then this will do the
job.

#!/usr/bin/perl

use strict;
use warnings;

while(my $current_line = <DATA>) {
   print "$1\n" if $current_line =~ /^\s+(Servers? .+)/;
}

__DATA__
---------------------------------
 --> Checking Server Hostname <--
---------------------------------
        Server Hostname: xxxxxxxxx
---------------------------------------
 --> Checking Authentication Domain <--
---------------------------------------
        Server is authenticating against: xxxxxxxxx

--------------------------------------
 --> Validating DNS Server Entries <--
--------------------------------------
        Servers should conform to global ANYCast Standard


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


Reply via email to