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:
Can a perl script launch another perl script?

 



brownjenkin
stranger

May 14, 2001, 6:34 AM

Post #1 of 2 (746 views)
Can a perl script launch another perl script? Can't Post

Hello,

I need my perl script (using ActivePerl 5.6.1 on Win98) to launch another perl script to find the "How long since modified" (-M) value of a file and report it back to the main script. Is this possible?

If not, is there a way around the fact that -M references itself to the time a perl script is launched?

Any input is appreciated.

Pete

don't panic...

Okay, I found a way around this, though if anyone does have an answer, it'd be cool to know.

I just used the Windows Task Scheduler as earlier suggested to run my script every 15 minutes - works like a charm!

Pete

(This post was edited by brownjenkin on May 14, 2001, 7:47 AM)


AICapone
Deleted

May 14, 2001, 6:24 PM

Post #2 of 2 (734 views)
Re: Can a perl script launch another perl script? [In reply to] Can't Post

Heyya. First of all, why do you need TWO scripts? everyting goes perfect inside only one. You need last modification date? To compare them, I assume. Well, dont forget that -M is another fancy way of saying
stat($file))[9] where $file is your file (though -M works much faster because `stat` returns an array of values)
So if you need to compare two files with their modification date, go ahead and use something like

@sorted_list = sort { (stat($a))[9] <=> (stat($b))[9] } @unsorted_list;

pretty obvious, ain't it?

Anyway, read perl `perldoc -f stat` and `perldoc -f sort` it will really help ya

P.S. Windows Task Scheduler he he... how did you ever think of that? :-)))))) Oh..yeah...you must've forgot that there is NO Task Scheduler in the `Net
P.P.S. general look is somethink like this:

($device_number, $inode, $permissions, $hardlinks, $uid, $gid, $dev_indent, $size_in_bytes, $last_acc, $last_mod, $ch_time, $blksize, $blk)=stat($file);

Rest in Peace,
AlCapone


 
 


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

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