Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

guts of Dynaloader

by xiaoyafeng (Chaplain)
on Apr 20, 2012 at 03:32 UTC ( #966068=perlquestion: print w/ replies, xml ) Need Help??
xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:

Hi gurus,

I'm now interested in guts Dynaloader. Where can I find the guts doc about it(and bootstrap etc.)

I reorganize my expression, hope it can make my question more clear.

I know perl put all dll/lib files in auto directory. and use it by Dynaloader. many years, I just use it, create it by h2xs. but don't think too much about its mechanics.

Along with my C knowledge rich up, I am more and more curious :

  • how perl call dynamic library in compile stage (use XYZ::XS module;)? I guess it seems like LoadLibrary function in windows
  • how perl call dynamic library in run time stage (require XYZ::XS module?)
  • I notice a bootstrap statement in pm file, what it does mean? and how does it work?
  • Please enlighten me~

    Thanks!





    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Comment on guts of Dynaloader
Re: internal about Dynaloader
by Anonymous Monk on Apr 20, 2012 at 05:24 UTC
Re: internal about Dynaloader
by quester (Vicar) on Apr 20, 2012 at 06:19 UTC

    Dynaloader is a CPAN module, so a Google search for "cpan Dynaloader" will have the Dynaloader POD documentation as the first result. You could also get that with the command perldoc Dynaloader on a system with Perl (and Dynaloader) installed.

    You can look at the source code with the "Source" link near the top left of the CPAN web page. If you are on a Unix-like system, locate -i DynaLoader.pm should find a copy of the source code on your system.

    If you have a more specific question after looking through the source code feel free to ask.

Re: internal about Dynaloader
by xiaoyafeng (Chaplain) on Apr 20, 2012 at 08:27 UTC
    hope the post updated can express my questions more clear. ;)




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Re: guts of Dynaloader
by syphilis (Canon) on Apr 20, 2012 at 12:13 UTC
    Both use XYZ::XS; and require XYZ::XS; load the dll in exactly the same way (by using LoadLibrary on Windows).

    The only difference (afaik) in the loading of the dll is in *when* it happens. If you use XYZ::XS; then the loading is done at script compile-time (whenever the compilation process gets to that compile-time command).
    And if you require XYZ::XS; then the loading is done at script run-time (whenever the execution process gets to that run-time command).

    Cheers,
    Rob

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-12-20 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls