in reply to Re: A Tribute To The Monks Of Wisdom
in thread A Tribute To The Monks Of Wisdom

Liked your code (++), but wanted to avoid "eval" - this works :
#!/usr/bin/perl use strict; use warnings; my %test2 = ( 'a data file' => sub {-f _}, 'a directory' => sub {-d _}, 'readable' => sub {-r _}, 'writable' => sub {-w _}, 'executable' => sub {-x _}, ); die "Usage: $0 [path/]file.name ...\n" unless @ARGV; for my $file ( @ARGV ) { my $report = "$file does not exist\n"; if ( -e $file ) { $report = "$file exists and is:\n"; for my $t ( sort keys %test2 ) { $report .= " ... $t\n" if $test2{$t}->(); } } print "$report\n"; }

     Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax