Jeff japhy Pinyan said:
> On Nov 22, Chris Browning said:
>
>>On Thursday 21 November 2002 03:21 am, cedric gross wrote:
>>> Hello every body,
>>>
>>> How to know what task have run a perl script ?
>>> I mean is possible to get within the code which process Id have start
>>> the script.
>>
>>If you're running Linux or Unix, perl holds your environment variables
>> in a hash; %ENV. Your process id number is $ENV{PID}.
>
> You can just use the $$ variable too.
Good answers to the wrong quiestion ;-)
I think the requirement is to find the process id of the parent process.
$ENV{PPID} might give you that (it does on Solaris 8 which doesn't have
$PID) or you might be able to find out by calling C<getppid>.
perl -V:d_getppid
will tell you whether your perl supports this call.
perldoc -f getppid
for what it's worth ;-)
[ Didn't someone already answer this? Oh for a decent threaded webmail
thingy. ]
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]