Re: OT: a short Perl question

2002-04-28 Thread Nadav Har'El
On Sun, Apr 28, 2002, Dan Kenigsberg wrote about "Re: OT: a short Perl question": > Thanks to everyone who answered me on and off the list. > > print "standalone\n" if (!caller); Interesting. Dan, thanks for posting the answer you got here. I was interes

Re: OT: a short Perl question

2002-04-28 Thread Dan Kenigsberg
Thanks to everyone who answered me on and off the list. print "standalone\n" if (!caller); seems just what I've been looking for. (comparing $0 to the script's name would also work most of the times.) Dan. = To unsubscrib

Re: OT: a short Perl question

2002-04-27 Thread guy keren
On Sat, 27 Apr 2002, Dan Kenigsberg wrote: > How can I tell, within a Perl script, whether it was executed from the command > line, or use'd by another script? you can only use a heuristics - use 'getppid()' to get the PID of the parrent process. then use 'ps -o comm PID' to get its command lin