CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Help!

 



jbs
Deleted

Jun 2, 2000, 12:44 PM

Post #1 of 3 (277 views)
Help! Can't Post

Hello, I'm an ex-html programmer recently reborn. In my job I have recently been di-vied as the person to maintain an interal webserver. There is a question I have on some perl code written by those before me. Tne code is as follows:


#!/usr/bin/perl

use File::Find;
use Cwd;

#print "usage: $0 <dirpath>\n" unless @ARGV;
$dirpath=cwd();#GET CURRENT DIRPATH

find(\&zap, $dirpath);


sub zap {

if (-f && -M _ > 5){
print "$File::Find::name\n";

unlink($File::Find::name) && print "deleted $File::Find::name\n";
}

if (!-l && -d _) {
rmdir($File::Find::name) && print "removed $File::Find::name\n";
}

}
# end

My question is what do the -f,-M,!-l, and -d do?? I cant seem to find references to these parameters anywhere.
-jbs


perlkid
stranger

Jun 3, 2000, 12:18 AM

Post #2 of 3 (277 views)
Re: Help! [In reply to] Can't Post

 
The -f checks to see if the file is a plain text file.

-M checks the age of the file in days when the script started.

-l , Checks If is a symbolic Link.

I didn't know what the -l was so that description came from a book.

Perlkid



perlkid
stranger

Jun 3, 2000, 12:19 AM

Post #3 of 3 (277 views)
Re: Help! [In reply to] Can't Post

 
Ohh yea,

And For future reference if you look for them again their called file test operators.

perlkid Smile

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives