Created
February 5, 2015 09:48
-
-
Save paveljurca/07881f4d5defcabd566f to your computer and use it in GitHub Desktop.
stat $mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use 5.010.1; | |
use strict; | |
use warnings; | |
for (@ARGV) { | |
say "[ $_ ]"; | |
say " - $_" for file_test($_); | |
} | |
sub file_test { | |
my $file = shift; | |
my @mode; | |
return "\Unot found" unless (-e $file); | |
push @mode, "readable" if -r _; | |
push @mode, "writable" if -w _; | |
push @mode, "executable" if -x _; | |
return @mode; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment