Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Module caller

by suaveant (Parson)
on May 06, 2015 at 13:41 UTC ( #1125837=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1125837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2020-05-30 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (171 votes). Check out past polls.

    Notices?