| 1 |
package ExtUtils::MakeMaker::bytes; |
| 2 |
|
| 3 |
use vars qw($VERSION); |
| 4 |
$VERSION = 0.01; |
| 5 |
|
| 6 |
my $Have_Bytes = eval q{require bytes; 1;}; |
| 7 |
|
| 8 |
sub import { |
| 9 |
return unless $Have_Bytes; |
| 10 |
|
| 11 |
shift; |
| 12 |
unshift @_, 'bytes'; |
| 13 |
|
| 14 |
goto &bytes::import; |
| 15 |
} |
| 16 |
|
| 17 |
1; |
| 18 |
|
| 19 |
|
| 20 |
=head1 NAME |
| 21 |
|
| 22 |
ExtUtils::MakeMaker::bytes - Version agnostic bytes.pm |
| 23 |
|
| 24 |
=head1 SYNOPSIS |
| 25 |
|
| 26 |
use just like bytes.pm |
| 27 |
|
| 28 |
=head1 DESCRIPTION |
| 29 |
|
| 30 |
bytes.pm was introduced with 5.6. This means any code which has 'use |
| 31 |
bytes' in it won't even compile on 5.5.X. Since bytes is a lexical |
| 32 |
pragma and must be used at compile time we can't simply wrap it in |
| 33 |
a BEGIN { eval 'use bytes' } block. |
| 34 |
|
| 35 |
ExtUtils::MakeMaker::bytes is just a very thin wrapper around bytes |
| 36 |
which works just like it when bytes.pm exists and everywhere else it |
| 37 |
does nothing. |
| 38 |
|
| 39 |
=cut |