Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: My Perl Obfuscator

by jwkrahn (Abbot)
on Jan 12, 2024 at 00:47 UTC ( [id://11156904]=note: print w/replies, xml ) Need Help??

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 (Chaplain) on Jan 12, 2024 at 01:10 UTC
    Oh, I didn't realize that. Thank you!!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11156904]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-05-28 07:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found