rockstar99 has asked for the wisdom of the Perl Monks concerning the following question:
But not able to get it. Kindly let me know how to get the string from the matched pattern to EOF. Thanks in advance.#!/usr/local/bin/perl my $file="show_configuration.out"; open (FILE, $file) or die "Can't open $file: $!\n"; select((select(FILE), $/ = undef)[0]); my $filecontents = <FILE>; close (FILE); if($filecontents =~ /\*\sdisks/){ my @matchsect = /\*\sdisks/; print "@matchsect\n\n"; } else{ print "No such pattern\n"; }
|
|---|