diff options
author | Michael G. Schwern <schwern@pobox.com> | 2003-08-29 15:55:07 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-30 05:50:41 +0000 |
commit | 9e8c31cc7f224d58a5cb5107b5900855526a273c (patch) | |
tree | db62fe953e66600c6f5cf2e9ef4958d061f12c3e /ext/DynaLoader/XSLoader_pm.PL | |
parent | d84c672d23e941bae9d05e88fa42ae466c892856 (diff) | |
download | perl-9e8c31cc7f224d58a5cb5107b5900855526a273c.tar.gz |
XSLoader nits and tests
Message-ID: <20030830055507.GI25970@windhund.schwern.org>
p4raw-id: //depot/perl@20944
Diffstat (limited to 'ext/DynaLoader/XSLoader_pm.PL')
-rw-r--r-- | ext/DynaLoader/XSLoader_pm.PL | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/ext/DynaLoader/XSLoader_pm.PL b/ext/DynaLoader/XSLoader_pm.PL index 9f3aaed83c..26e67c8347 100644 --- a/ext/DynaLoader/XSLoader_pm.PL +++ b/ext/DynaLoader/XSLoader_pm.PL @@ -14,19 +14,7 @@ print OUT <<'EOT'; package XSLoader; -# And Gandalf said: 'Many folk like to know beforehand what is to -# be set on the table; but those who have laboured to prepare the -# feast like to keep their secret; for wonder makes the words of -# praise louder.' - -# (Quote from Tolkien sugested by Anno Siegel.) -# -# See pod text at end of file for documentation. -# See also ext/DynaLoader/README in source tree for other information. -# -# Tim.Bunce@ig.co.uk, August 1994 - -$VERSION = "0.01"; # avoid typo warning +$VERSION = "0.02"; # enable debug/trace messages from DynaLoader perl code # $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; @@ -45,14 +33,11 @@ boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); package XSLoader; -1; # End of main code - -# The bootstrap function cannot be autoloaded (without complications) -# so we define it here: - sub load { package DynaLoader; + die q{XSLoader::load('Your::Module', $Your::Module::VERSION)} unless @_; + my($module) = $_[0]; # work with static linking too @@ -137,6 +122,8 @@ print OUT <<'EOT'; goto &DynaLoader::bootstrap_inherit; } +1; + __END__ =head1 NAME @@ -148,7 +135,7 @@ XSLoader - Dynamically load C libraries into Perl code package YourPackage; use XSLoader; - XSLoader::load 'YourPackage', @args; + XSLoader::load 'YourPackage', $YourPackage::VERSION; =head1 DESCRIPTION |