in reply to Re: caller of perl script
in thread caller of perl script

moritz: OP mentioned a .BAT file. Is getppid implemented on Windows?

OP: If you have any control over the calling script, could you modify it to leave tracks in an environment variable?

Replies are listed 'Best First'.
Re^3: caller of perl script
by moritz (Cardinal) on Jun 11, 2010 at 16:11 UTC
    moritz: OP mentioned a .BAT file. Is getppid implemented on Windows?

    Concluding the operating system from a file extension is a fragile business. I think that mono uses .exe executables on linux.

    Also there are a lot of different systems that use .BAT - the difference between DOS 6.0 and Windows 7 are striking.

    Perl 6 - links to (nearly) everything that is Perl 6.
      What's wrong with $^O ?

        Whoops!

        c>$^O</c> is the name of the currently running script, not the name of the thing from which it was started.

Re^3: caller of perl script
by Anonymous Monk on Jun 16, 2010 at 00:16 UTC
    OP mentions both bat and shell, which likely means both Windows and Unix. most of the responses reference Windows. sadly, modules for Windows (e.g. Windows::...) can't be used in Unix. it's also likely that wild and crazy modules (though we love 'em) may not be an option. OP could be in a locked down environment where they've got to use what they've got.