die "$file does not exist!\n" unless -e $file; my @perms; push @perms, 'read' if -r _; push @perms, 'write' if -w _; push @perms, 'execute' if -x _; if ( @perms ) { printf "You have %s perms\n", join(", ", @perms); } else { print "You got zip\n"; }