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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
why the codes can not be executed?


New User

Dec 16, 2002, 12:16 AM

Post #1 of 2 (624 views)
why the codes can not be executed? Can't Post

hello, i have a segment of code as followed:
#path for rlog command
$CMD{rlog} = 'D:/project/programs/rcs';
if (defined($tag)) {
if (!open($fh, "-|")) { #TRUE
open(STDERR, '>/dev/null') ;
# execute rlog comand for a list of the files
exec($CMD{rlog}, @files) or exit -1;
} else {

I found that the code after this segment can not be executed at all. even a print operation can get nothing displyed. I don't know why. Seems the current task executed by this segment can not exit so that the program can not continue. but i indeed put "exit" there.
what is wrong with code?
pls help! thanks alot

Thaumaturge / Moderator

Dec 16, 2002, 1:34 AM

Post #2 of 2 (623 views)
Re: [kaguya] why the codes can not be executed? [In reply to] Can't Post

You almost certainly don't want "exec". You probably want "system" instead. You should read the docs on these two functions.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks


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

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