s/user::/USER:$o:/ for @A; # make native Linux dir/file permissions uppercase s/group::/GROUP:$g:/ for @A; # idem s/other::/OTHER::/ for @A; # idem