summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-03-20 10:29:38 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-03-20 10:29:38 +0000
commit5ae7f1db2320c737db79389c37b2b4a58be7659b (patch)
tree056a6946d106441839bdf02bc1cebb896063e2ef
parent3a8dc7fad1166feb6259d341a18fb6e8fbeed5b6 (diff)
downloadperl-5ae7f1db2320c737db79389c37b2b4a58be7659b.tar.gz
perl 5.002_01: utils/h2xs.PL
Use $^O, add autoflush to sample test.pl, and try not to assume we've got /bin/ls around when creating MANIFEST
-rw-r--r--utils/h2xs.PL15
1 files changed, 11 insertions, 4 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index 4e64d86885..f9868dc37f 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -15,8 +15,7 @@ use File::Basename qw(&basename &dirname);
chdir(dirname($0));
($file = basename($0)) =~ s/\.PL$//;
$file =~ s/\.pl$//
- if ($Config{'osname'} eq 'VMS' or
- $Config{'osname'} eq 'OS2'); # "case-forgiving"
+ if ($^O eq 'VMS' or $^O eq 'os2'); # "case-forgiving"
open OUT,">$file" or die "Can't create $file: $!";
@@ -576,7 +575,7 @@ print EX <<'_END_';
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
-BEGIN {print "1..1\n";}
+BEGIN { $| = 1; print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
_END_
print EX <<_END_;
@@ -603,7 +602,15 @@ print EX "\t- original version; created by h2xs $H2XS_VERSION\n\n";
close(EX) || die "Can't close $ext$modpname/Changes: $!\n";
warn "Writing $ext$modpname/MANIFEST\n";
-system '/bin/ls > MANIFEST' or system 'ls > MANIFEST';
+open(MANI,'>MANIFEST') or die "Can't create MANIFEST: $!";
+@files = <*>;
+if (!@files) {
+ eval {opendir(D,'.');};
+ unless ($@) { @files = readdir(D); closedir(D); }
+}
+if (!@files) { @files = map {chomp && $_} `ls`; }
+print MANI join("\n",@files);
+close MANI;
!NO!SUBS!
close OUT or die "Can't close $file: $!";