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

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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11156904]
help
Chatterbox?
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
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found