Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Module caller

by suaveant (Parson)
on May 06, 2015 at 13:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1125837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found