http://qs321.pair.com?node_id=1125837


in reply to Module caller

FindBin or $0 could also be used.

                - Ant
                - Some of my best work - (1 2 3)

Replies are listed 'Best First'.
Re^2: Module caller
by marinersk (Priest) on May 06, 2015 at 17:47 UTC

    I should think Findbinand $0 would be more helpful in figuring out how the script was called, but I don't see how it can help find who called the Module.

    Can you post an example?

      You said the name of the script calling the module, so I'd assumed you meant the actual script being run. If you mean what file the use or require was called from then no, FindBin and $0 won't help in that case.

                      - Ant
                      - Some of my best work - (1 2 3)

        #!/usr/bin/env perl # File is named zeroTest.pl. $0 = "Oh, sure, why not?"; print $0, $/;
        moo@cow[27]~>zeroTest.pl Oh, sure, why not?

        :P