#!/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 = ; close (FILE); if($filecontents =~ /\*\sdisks/){ my @matchsect = /\*\sdisks/; print "@matchsect\n\n"; } else{ print "No such pattern\n"; }