ByteLoader.pm 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package ByteLoader;
  2. use XSLoader ();
  3. our $VERSION = '0.09';
  4. # XSLoader problem:
  5. # ByteLoader version 0.0601 required--this is only version 0.06_01 at ./bytecode2.plc line 2.
  6. # on use ByteLoader $ByteLoader::VERSION;
  7. # Fixed with use ByteLoader '$ByteLoader::VERSION';
  8. # Next problem on perl-5.8.3: invalid floating constant suffix _03"
  9. if ($] < 5.009004) {
  10. # Need to check if ByteLoader is not already linked statically.
  11. # Before 5.6 byterun was in CORE, so we have no name clash.
  12. require Config; Config->import();
  13. if ($Config{static_ext} =~ /\bByteLoader\b/) {
  14. # We overrode the static module with our site_perl version. Which version?
  15. # We can only check the perl version and guess from that. From Module::CoreList
  16. $VERSION = '0.03' if $] >= 5.006;
  17. $VERSION = '0.04' if $] >= 5.006001;
  18. $VERSION = '0.05' if $] >= 5.008001;
  19. $VERSION = '0.06' if $] >= 5.009003;
  20. $VERSION = '0.06' if $] >= 5.008008 and $] < 5.009;
  21. } else {
  22. XSLoader::load 'ByteLoader'; # fake the old backwards compatible version
  23. }
  24. } else {
  25. XSLoader::load 'ByteLoader', $VERSION;
  26. }
  27. 1;
  28. __END__
  29. =head1 NAME
  30. ByteLoader - load byte compiled perl code
  31. =head1 SYNOPSIS
  32. use ByteLoader 0.08;
  33. <byte code>
  34. perl -MByteLoader bytecode_file.plc
  35. perl -MO=Bytecode,-H,-ofile.plc file.pl
  36. ./file.plc
  37. =head1 DESCRIPTION
  38. This module is used to load byte compiled perl code as produced by
  39. C<perl -MO=Bytecode=...>. It uses the source filter mechanism to read
  40. the byte code and insert it into the compiled code at the appropriate point.
  41. =head1 AUTHOR
  42. Tom Hughes <tom@compton.nu> based on the ideas of Tim Bunce and others.
  43. Many changes by Enache Adrian <enache@rdslink.ro> 2003 a.d.
  44. and Reini Urban <rurban@cpan.org> 2008-2011.
  45. =head1 SEE ALSO
  46. perl(1).
  47. =cut
  48. # Local Variables:
  49. # mode: cperl
  50. # cperl-indent-level: 4
  51. # fill-column: 100
  52. # End:
  53. # vim: expandtab shiftwidth=4: