Paul Kraus wrote:

> I want the parent process to end. I am just trying to decide if I can
> start a second script without having to tie them together in a batch
> file.

exec overlays the memory image of the calling process, i.e. the calling
process is gone
after the call to exec. I wouldn't exactly classify the relationship
between the calling process
and called process as a parent child relationship. Run proca.pl and see
the output

### proca.pl start ###
#!/usr/local/bin/perl -w
use strict;

print "proca: I am $$\n";
my $parent = getppid ();
print "proca: parent is $parent\n";
exec ('procb.pl');
### proca.pl end ###

### procb.pl start ###
#!/usr/local/bin/perl -w
use strict;

print "procb: I am $$\n";
my $parent = getppid ();
print "procb: parent is $parent\n";
### procb.pl end ###

>
>
> > -----Original Message-----
> > From: Kipp, James [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, December 13, 2002 9:15 AM
> > To: 'Paul Kraus'; 'Perl'
> > Subject: RE: Calling another perl script
> >
> >
> > I rarely use 'exec' but i believe the parent script just
> > exits . here is some more from  the docs:
> >
> > Since it's a common mistake to use "exec" instead of
> > "system", Perl warns you if there is a following statement
> > which isn't "die", "warn", or "exit" (if "-w" is set - but
> > you always do that). If you *really* want to follow an "exec"
> > with some other statement, you can use one of these styles to
> > avoid the warning:
> >
> >     exec ('foo')   or print STDERR "couldn't exec foo: $!";
> >     { exec ('foo') }; print STDERR "couldn't exec foo: $!";
> >
> > ----
> > or maybe i am not understaning you correctly. could you be
> > talking about fork -> exec?
> >
> > HTH
> > Jim


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to