in reply to My Perl Obfuscator

-e $F or return 0; # File exists? -f $F or return 0; # It's a plain file?

You don't need both tests because if -f $F is true then -e $F has to be true.

$ mkdir test $ mkdir test/file1.txt $ touch test/file2.txt $ perl -le'print "abcdefg"' > test/file3.txt $ perl -le'print "\x90\x91\x92\x93\x94\x95\x96"' > test/file4.txt $ perl -e'for my $file ( @ARGV ) { print "$file: "; if ( -e $file ) { +print "EXISTS " } if ( -f $file ) { print "PLAIN " } print "\n" }' te +st/file* test/file1.txt: EXISTS test/file2.txt: EXISTS PLAIN test/file3.txt: EXISTS PLAIN test/file4.txt: EXISTS PLAIN
Naked blocks are fun! -- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re^2: My Perl Obfuscator
by harangzsolt33 (Deacon) on Jan 12, 2024 at 01:10 UTC
    Oh, I didn't realize that. Thank you!!