How do I find the name of the script which called my current script, in Perl?
What name? Files may have names, but files are just files, they don't do anything. They certainly don't call scripts.

Now, a process may "call" another process (I presume with "call" you mean a regular fork/exec combo, and not some RPC or doors call, a knock on the window by a signal), but processes, they are like crossing deserts on horses - they have no names. Processes have numbers. And processes have an additional variable, which contains the number of their parent process. Which may be the process that forked/execed the current process, but it may not, as said process may have ceased to exist. In which case, the parent process is the init() process. (Well, on Unixy systems; I've no clue what happens on a Windows system)


In reply to Re: Find name of calling script? by JavaFan
in thread Find name of calling script? by tel2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.