From: Perl 5 Porters Date: Sun, 17 Mar 1996 10:18:21 +0000 (+0000) Subject: Use $^O X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f360dba143c864a53fdb1573b40795cfe2331220;p=p5sagit%2Fp5-mst-13.2.git Use $^O --- diff --git a/lib/ExtUtils/Mkbootstrap.pm b/lib/ExtUtils/Mkbootstrap.pm index 1dbcf86..06c0015 100644 --- a/lib/ExtUtils/Mkbootstrap.pm +++ b/lib/ExtUtils/Mkbootstrap.pm @@ -58,8 +58,6 @@ generated C<*.bs> file. if (-f "${baseext}_BS"){ $_ = "${baseext}_BS"; package DynaLoader; # execute code as if in DynaLoader - local($osname, $dlsrc) = (); # avoid warnings - ($osname, $dlsrc) = @Config::Config{qw(osname dlsrc)}; $bscode = ""; unshift @INC, "."; require $_; @@ -78,7 +76,7 @@ generated C<*.bs> file. or die "Unable to open $baseext.bs: $!"; print STDOUT "Writing $baseext.bs\n"; print STDOUT " containing: @all" if $Verbose; - print BS "# $baseext DynaLoader bootstrap file for $Config{'osname'} architecture.\n"; + print BS "# $baseext DynaLoader bootstrap file for $^O architecture.\n"; print BS "# Do not edit this file, changes will be lost.\n"; print BS "# This file was automatically generated by the\n"; print BS "# Mkbootstrap routine in ExtUtils::Mkbootstrap (v$Version).\n"; diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 8a17173..97cb668 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -91,13 +91,12 @@ This module was last revised 14-Feb-1996, for perl 5.002. $VERSION is $VERSION = "1.01"; # That's my hobby-horse, A.K. require 5.000; -use Config; use Carp; require Exporter; @ISA = qw( Exporter ); @EXPORT = qw( mkpath rmtree ); -$Is_VMS = $Config{'osname'} eq 'VMS'; +$Is_VMS = $^O eq 'VMS'; sub mkpath { my($paths, $verbose, $mode) = @_; diff --git a/pod/pod2html.PL b/pod/pod2html.PL index aee400d..646190b 100644 --- a/pod/pod2html.PL +++ b/pod/pod2html.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: $!"; diff --git a/pod/pod2man.PL b/pod/pod2man.PL index 0478a0b..d8f7cbb 100644 --- a/pod/pod2man.PL +++ b/pod/pod2man.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: $!"; @@ -395,17 +394,20 @@ if ($name ne 'something') { FCHECK: { open(F, "< $ARGV[0]") || die "can't open $ARGV[0]: $!"; while () { + next unless /^=\b/; if (/^=head1\s+NAME\s*$/) { # an /m would forgive mistakes $_ = ; unless (/\s*-+\s+/) { $oops++; - warn "$0: Improper man page - no dash in NAME header in paragraph $. of $ARGV[0]:\n" + warn "$0: Improper man page - no dash in NAME header in paragraph $. of $ARGV[0]\n" } %namedesc = split /\s+-\s+/; last FCHECK; } + next if /^=cut\b/; # DB_File and Net::Ping have =cut before NAME + die "$0: Invalid man page - 1st pod line is not NAME in $ARGV[0]\n"; } - die "$0: Invalid man page - no NAME line in $ARGV[0]\n"; + die "$0: Invalid man page - no documentation in $ARGV[0]\n"; } close F; } @@ -793,7 +795,7 @@ while (<>) { } elsif ($Cmd eq 'back') { $indent = pop(@indent); - warn "Unmatched =back\n" unless defined $indent; + warn "$0: Unmatched =back in paragraph $. of $ARGV\n" unless defined $indent; $needspace = 1; } elsif ($Cmd eq 'item') { @@ -805,7 +807,7 @@ while (<>) { # this is just a comment } else { - warn "Unrecognized pod directive: $Cmd\n"; + warn "$0: Unrecognized pod directive in paragraph $. of $ARGV: $Cmd\n"; } } else { @@ -951,7 +953,7 @@ sub noremap { sub init_noremap { if ( /[\200-\377]/ ) { - warn "high bit char in input stream"; + warn "$0: high bit char in input stream in paragraph $. of $ARGV\n"; } } @@ -975,7 +977,7 @@ sub clear_noremap { exists $HTML_Escapes{$1} ? do { $HTML_Escapes{$1} } : do { - warn "Unknown escape: $& in $_"; + warn "$0: Unknown escape in paragraph $. of $ARGV: ``$&''\n"; "E<$1>"; } } diff --git a/pod/pod2text.PL b/pod/pod2text.PL index 1402f0d..4919807 100644 --- a/pod/pod2text.PL +++ b/pod/pod2text.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: $!"; diff --git a/t/lib/safe.t b/t/lib/safe.t index dfd6032..e59c814 100755 --- a/t/lib/safe.t +++ b/t/lib/safe.t @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; import Config; - if ($Config{'extensions'} !~ /\bSafe\b/ && $Config{'osname'} ne 'VMS') { + if ($Config{'extensions'} !~ /\bSafe\b/ && $^O ne 'VMS') { print "1..0\n"; exit 0; } diff --git a/utils/h2ph.PL b/utils/h2ph.PL index 3b882fe..370aa87 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -16,8 +16,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: $!"; diff --git a/utils/pl2pm.PL b/utils/pl2pm.PL index 4e69036..e8277bb 100644 --- a/utils/pl2pm.PL +++ b/utils/pl2pm.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: $!"; diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL index fd8b134..32f78fe 100644 --- a/x2p/find2perl.PL +++ b/x2p/find2perl.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: $!"; diff --git a/x2p/s2p.PL b/x2p/s2p.PL index 4f7293d..29864b4 100644 --- a/x2p/s2p.PL +++ b/x2p/s2p.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: $!";