use strict; use warnings; open(IN, "xcacls.txt") or die "Cant open file: $!\n"; ##### Puts file into $_ all at once, rather than just a ##### line at a time. $_ = do { local $/; }; ##### Matches the section bounded by lines of 74 *'s ##### that has Directory: in its first line. m/\*{74}\n(Directory: .*?)\*{74}/s; ##### Print the first part of the match (the first ##### section in parentheses) print $1; close(IN);