use strict; use warnings; while () { chomp; if (m/^File: (.*)/) { print "$1 allows:\n"; } elsif (m/^Allowed (.*)/) { print "$1\n"; } } __DATA__ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File: G:\xcacls.txt Permissions: Type Username Permissions Inheritance Allowed BUILTIN\Administrators Full Control This Folder Only Allowed \Everyone Read and Execute This Folder Only Allowed NT AUTHORITY\SYSTEM Full Control This Folder Only * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *