diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-07-07 15:12:42 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-07-09 07:54:26 +0200 |
commit | 566e3efea3c525320e489c80ef426a6cfc5df4a1 (patch) | |
tree | b41da301a4d8598bc89fdebf4abe3cd323606b8e /lib | |
parent | f8d6280ff20162987d9905bbb380d50485ce4e99 (diff) | |
download | perl-566e3efea3c525320e489c80ef426a6cfc5df4a1.tar.gz |
Refactor ExtUtils::Embed to work with miniperl.
Remove the use of FileHandle, which relies on IO, and XS module.
Only load Getopt::Std if it is needed (in xsinit()), to avoid needing to add
Getopt::Std to lib/buildcustomize.pl
Require File::Spec instead of using it, as it exports nothing, so there is no
benefit to using it (but it costs a BEGIN block).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExtUtils/Embed.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm index 9710630e51..758e24139c 100644 --- a/lib/ExtUtils/Embed.pm +++ b/lib/ExtUtils/Embed.pm @@ -2,10 +2,8 @@ require 5.002; package ExtUtils::Embed; require Exporter; -require FileHandle; use Config; -use Getopt::Std; -use File::Spec; +require File::Spec; #Only when we need them #require ExtUtils::MakeMaker; @@ -18,7 +16,7 @@ use vars qw(@ISA @EXPORT $VERSION use strict; # This is not a dual-life module, so no need for development version numbers -$VERSION = '1.30'; +$VERSION = '1.31'; @ISA = qw(Exporter); @EXPORT = qw(&xsinit &ldopts @@ -54,7 +52,8 @@ sub xsinit { @mods = @$mods if $mods; } else { - getopts('o:s:'); + require Getopt::Std; + Getopt::Std::getopts('o:s:'); $file = $opt_o if defined $opt_o; $std = $opt_s if defined $opt_s; @mods = @ARGV; @@ -65,7 +64,8 @@ sub xsinit { $fh = \*STDOUT; } else { - $fh = new FileHandle "> $file"; + open $fh, '>', $file + or die "Can't open '$file': $!"; } push(@mods, static_ext()) if defined $std; |