http://www.perlmonks.org?node_id=130492

ybiC has asked for the wisdom of the Perl Monks concerning the following question:

  Greetz fellow monks,
How can I replace the '-e' below with the $perm variable?   I've tried tips from this (superficially similar) thread to no avail.   Help?
sub FileCheck { my $file = $_[0]; my $perm = $_[1]; my $ooot = $_[2]; ## unless (-$perm $file) { unless (-e $file) { if ($ooot eq 'die') { die "\nError (fatal) accessing $file: $!"; } elsif ($ooot eq 'warn') { warn "\nError (non-fatal)accessing $file: $!"; } } }

    cheers,
    Don
    striving toward Perl Adept
    (it's pronounced "why-bick")