diff options
author | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +0000 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-08-07 00:00:00 +0000 |
commit | 8490252049bf42d3d2f75d89178a8682bf22ba74 (patch) | |
tree | 71550615591dde7ae3fdf7f2e1be055faf33675e /lib | |
parent | 59586d7795db81c5ffcd935ba8614353199c2a71 (diff) | |
download | perl-8490252049bf42d3d2f75d89178a8682bf22ba74.tar.gz |
[inseperable differences up to perl 5.004_02]perl-5.004_02
[editor's note - this list of differences was built manually, so is
either a little inaccurate or the most well preened out of the
"unapplied changes" lists so far. It certainly didn't get the usual
injection of message bodies.
The aim of these changes is to give you a vector for finding a list
message if you have an annotate operation hit this commit]
------ BUILD PROCESS ------
Title: "[PATCH]: HP-UX 10 w/o transition links"
From: Jeff Okamoto <okamoto@hpcc123.corp.hp.com>
Msg-ID: <199706231650.AA070364627@hpcc123.corp.hp.com>
Files: Configure
Title: "INSTALL updates for GNU ld and __inet_* errors"
From: Andy Dougherty <doughera@newton.phys.lafayette.edu>
Files: INSTALL
------ CORE LANGUAGE ------
Title: "[PATCH] Additional patch for "Can't execute ...""
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Msg-ID: <199707191651.MAA04897@monk.mps.ohio-state.edu>
Files: pod/perldiag.pod perl.c
See 21fc060b433a5fd003b9aca5789342207c46ada4 and
2a92aaa05aa1acbf01092228d30e9b1d7b2a3f61
Title: "[PATCH] Re: Can't pack literals as pointers"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199708012250.SAA20278@aatma.engin.umich.edu>
Files: pod/perldiag.pod pod/perlfunc.pod pp.c t/op/pack.t
On Wed, 25 Jun 1997 00:23:18 GMT, John Tobey wrote:
>
>IMHO, pack("p","foo") should evaluate to a pointer that's valid
>in the current context. pack("p",undef) should return the NULL
>value. Currently, they both produce the error "Modification of a
>read-only value attempted".
>
>This looks pretty easy to fix, so I've prepared a diff against
>the 5.004_01 distribution. This tests fine on my Linux. I hope
>I'm not introducing a memory leak or other ailment...
That doesn't look quite right to me. When provided a literal, you
should point at the actual literal (which normally has a global
lifetime), rather than making a mortal copy of it and pointing at
that. The mortal copy will be destroyed at the next statement
boundary, and you'll be left with a dangling pointer when you
unpack().
You're doing the very thing the XXX comment above was intended to
highlight.
I do agree that literals should be pack('p')-able. So, I'd suggest
the change be modified [...]
Title: "One-liner regex causes SEGV on 5.003 under HP-UX and Linux"
From: Hugo van der Sanden <hv@crypt.compulink.co.uk>
Msg-ID: <199707061144.MAA04443@crypt.compulink.co.uk>
Files: regexec.c t/op/re_tests
[was originally credited as the same change as
44ed422101809141bc33c2b85c1cff357de4d7bf]
Title: "Free temps before calling END blocks", "Too late destruction"
From: Chip Salzenberg <chip@rio.atlantic.net>
Msg-ID: <m33erfv5hx.fsf@chany-p100.emwp.com>
Files: perl.c
Title: "Forbid "goto" into middle of foreach loop"
From: Chip Salzenberg <chip@rio.atlantic.net>
Files: pod/perldiag.pod pp_ctl.c
Title: "[PATCH] m2t2: problem in NetBSD 1.2D with sfio"
From: Jarkko Hietaniemi <jhi@iki.fi>
Files: perl.h
Title: "Forbid negative splice offset beyond array start"
From: "John L. Allen" <allen@gateway.grumman.com>, Chip Salzenberg
<chip@rio.atlantic.net>
Msg-ID: <Pine.SOL.3.91.970625111744.19300A-100000@gateway>
Files: pp.c
Title: "Fix memory leak on eval 'sub {}'"
From: Chip Salzenberg <chip@rio.atlantic.net>
Files: pp_ctl.c
Title: "Fix C<qq #hi#>"
From: Chip Salzenberg <chip@rio.atlantic.net>
Files: toke.c
Title: "Don't warn about "${foo}" in string, even if &foo exists"
From: Chip Salzenberg <chip@rio.atlantic.net>
Files: toke.c
Title: "Perldb internal flag rehaul"
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: pod/perldebug.pod pod/perlvar.pod perl.h gv.c mg.c op.c perl.c
pp_ctl.c pp_hot.c pp_sys.c sv.c toke.c
Title: "Fix C<print $foo x 2> parsing"
From: "Chuck D. Phillips (NON-HP Employee)" <cdp@hpescdp.fc.hp.com>, Chip
Salzenberg <chip@rio.atlantic.net>
Msg-ID: <199706121737.KAA00503@palrel3.hp.com>
Files: toke.c
Title: "Fix lockf_emulate_flock() positioning"
From: Chip Salzenberg <chip@rio.atlantic.net>, gen@atd.rdc.ricoh.co.jp
Msg-ID: <199706091132.UAA00895@wampa.atd.rdc.ricoh.co.jp>
Files: pp_sys.c
Title: "[PATCH] Make DEBUGGING_MSTATS info consistent"
From: Andy Dougherty <doughera@newton.phys.lafayette.edu>
Msg-ID: <Pine.SUN.3.96.970731131529.3740A-100000@newton.phys>
Files: INSTALL pod/perldelta.pod perl.h
Title: "semctl broken under Linux"
From: Andreas Schwab <schwab@LS5.informatik.uni-dortmund.de>, Andreas
Schwab <schwab@issan.informatik.uni-dortmund.de>, Graham
Barr <gbarr@ti.com>, Tim Bunce <Tim.Bunce@ig.co.uk>
Msg-ID: <33C38291.2D9302DA@ti.com>,
<9707040912.AA03470@issan.informatik.uni-dortmund.de>,
<9707041538.AA08946@toad.ig.co.uk>,
<9707070924.AA11774@issan.informatik.uni-dortmund.de>,
<9707090933.AA19012@issan.informatik.uni-dortmund.de>
Files: doio.c
[one change made it, as 8e591e46b4c6543ed80895327199c4a628ce11b6]
Title: "One-liner regex causes SEGV on 5.003 under HP-UX and Linux"
From: Hugo van der Sanden <hv@crypt.compulink.co.uk>
Msg-ID: <199707061144.MAA04443@crypt.compulink.co.uk>
Files: regexec.c t/op/re_tests
[was originally credited as the same change as
44ed422101809141bc33c2b85c1cff357de4d7bf]
Title: "Fix up problems with *DBM tests"
From: Paul Marquess <pmarquess@bfsec.bt.co.uk>
Files: t/lib/gdbm.t t/lib/ndbm.t t/lib/odbm.t t/lib/sdbm.t
Title: "Faster int to string conversion",
"[PATCH} Re: memory leak in buffer
safety code"
From: Chip Salzenberg <chip@rio.atlantic.net>, Hugo van der Sanden
<hv@crypt.compulink.co.uk>, Tim Bunce <Tim.Bunce@ig.co.uk>
Msg-ID: <199707140912.KAA09935@crypt.compulink.co.uk>,
<199707142050.QAA20976@rio.atlantic.net>,
<199707182035.VAA20990@crypt.compulink.co.uk>,
<9707151040.AA02883@toad.ig.co.uk>
Files: global.sym sv.c
Title: "Fix '-' flag on sprintf() of floats"
From: Chip Salzenberg <chip@rio.atlantic.net>, Jarkko Hietaniemi
<jhi@iki.fi>
Msg-ID: <199705270646.JAA02510@alpha.hut.fi>
Files: sv.c
Title: "Don't use atol() for unsigned values", "signedness problem in
pack("N", "value");"
From: Chip Salzenberg <chip@rio.atlantic.net>, Roger Espel Llima
<espel@llaic.univ-bpclermont.fr>
Msg-ID: <19970531200007.40218@llaic.univ-bpclermont.fr>
Files: sv.c
Title: "Perldb internal flag rehaul"
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: pod/perldebug.pod pod/perlvar.pod perl.h gv.c mg.c op.c perl.c
pp_ctl.c pp_hot.c pp_sys.c sv.c toke.c
Title: "[PATCH] Exporter new export_to_level method"
From: epeschko@elmer.tci.com (Ed Peschko)
Files: lib/Exporter.pm
Title: "[MM] Small patch to MakeMaker, new release"
From: "Andreas J. Koenig" <k@anna.in-berlin.de>
Msg-ID: <199706281603.SAA10869@anna.in-berlin.de>
Files: lib/ExtUtils/Command.pm lib/ExtUtils/Install.pm
lib/ExtUtils/Liblist.pm lib/ExtUtils/MM_Unix.pm
lib/ExtUtils/MakeMaker.pm lib/ExtUtils/Mksymlists.pm
Title: "CPAN.pm, $VERSION and nested (bundled) modules."
From: a.koenig@kulturbox.de (Andreas J. Koenig)
Files: lib/ExtUtils/Install.pm lib/ExtUtils/Liblist.pm
lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MakeMaker.pm
lib/ExtUtils/Mksymlists.pm
Title: "Time::Local patch (plus perl.c and filehand.t)"
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Files: lib/Time/Local.pm perl.c t/lib/filehand.t
Title: "Slightly safer signals"
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: mg.c perl.c
Title: "Perldb internal flag rehaul"
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Files: pod/perldebug.pod pod/perlvar.pod perl.h gv.c mg.c op.c perl.c
pp_ctl.c pp_hot.c pp_sys.c sv.c toke.c
Title: "'use UNIVERSAL;' deprecated, do C<UNIVERSAL::isa()> instead",
"UNIVERSAL.pm and import methods"
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>, Gisle Aas <aas@bergen.sn.no>,
Graham Barr <gbarr@ti.com>, Gurusamy Sarathy
<gsar@engin.umich.edu>, Hugo van der Sanden
<hv@crypt.compulink.co.uk>
Msg-ID: <199706271701.NAA25664@aatma.engin.umich.edu>,
<199706271904.UAA00120@crypt.compulink.co.uk>,
<199706272054.QAA28913@aatma.engin.umich.edu>,
<199706301554.LAA03763@aatma.engin.umich.edu>,
<33B22248.7D7C1985@ti.com>,
<E0wf5TN-0006ps-00@taurus.cus.cam.ac.uk>,
<E0wguTR-0005bs-00@ursa.cus.cam.ac.uk>,
<E0whaZJ-0007BA-00@ursa.cus.cam.ac.uk>,
<E0whfHh-0007bW-00@ursa.cus.cam.ac.uk>,
<E0wiyUG-00073j-00@taurus.cus.cam.ac.uk>,
<hiuyv6q9k.fsf@bergen.sn.no>
Files: lib/Class/Struct.pm lib/File/Compare.pm lib/File/Copy.pm
t/op/universal.t universal.c
[two changes made it, as
d704f39a0db2dc23790dfd9d7bd59ce9928a6e2c,
e09f3e01ccd721309f0eb0aae224d84db2e8436a]
------ PORTABILITY - WIN32 ------
Title: "[PATCH] Embedding threaded apps in perl.dll"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199707261518.LAA24346@aatma.engin.umich.edu>,
<199707301833.OAA19570@aatma.engin.umich.edu>
Files: win32/win32.c
[one change made it, as
4dd614da4d1132b957c4951dd00f64d81b89dc20]
Title: "minor win32 scribbles"
From: Hugo van der Sanden <hv@crypt.compulink.co.uk>
Msg-ID: <199707270832.JAA19399@crypt.compulink.co.uk>
Files: README.win32
[nitpicking f7c603cbfba7c97f77e257c42aa119ffdb47fe1e]
Title: "[PATCH] binary coexistence on win32", "[RESEND] [PATCH] binary
coexistence on win32"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199707250109.VAA02666@aatma.engin.umich.edu>,
<199707301829.OAA19516@aatma.engin.umich.edu>
Files: lib/ExtUtils/Mksymlists.pm win32/win32.h win32/win32io.h
win32/win32iop.h win32/makedef.pl win32/win32.c
win32/win32io.c
Title: "WIN32 Build - pod2xxx.bat Missing?", "[PATCH] Re: WIN32 Build -
pod2xxx.bat Missing?"
From: Chris Williams <chrisw@netinfo.com.au>, Gurusamy Sarathy
<gsar@engin.umich.edu>
Msg-ID: <199707011423.KAA15855@aatma.engin.umich.edu>,
<33B8B962.D96FA1F5@netinfo.com.au>
Files: win32/Makefile win32/makefile.mk
Title: "[PATCH] docs for win32 utilities"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199707250045.UAA02510@aatma.engin.umich.edu>
Files: win32/bin/pl2bat.bat win32/bin/runperl.bat
Title: "[PATCH] trial2: some batch files won't run"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199708040226.WAA17301@aatma.engin.umich.edu>
Files: win32/bin/pl2bat.bat win32/bin/runperl.bat
Title: "[PATCH] win32 extras and embedding"
From: Gurusamy Sarathy <gsar@engin.umich.edu>
Msg-ID: <199707250232.WAA03421@aatma.engin.umich.edu>,
<199707301831.OAA19528@aatma.engin.umich.edu>
Files: dosish.h win32/win32.h perl.c win32/config.bc win32/config_H.bc
win32/makedef.pl win32/perllib.c win32/win32.c
[one change was applied (hastily), as
ad2e33dc060dc2ccf73a5ff1557a69a9b09c30c8]
------ PORTABILITY - OTHER ------
Title: "Additional OS/2 patches"
From: Gurusamy Sarathy <gsar@engin.umich.edu>, Ilya Zakharevich
<ilya@math.ohio-state.edu>
Msg-ID: <199708020823.EAA19521@monk.mps.ohio-state.edu>,
<199708021424.KAA28561@aatma.engin.umich.edu>,
<199708042108.RAA27671@aatma.engin.umich.edu>
Files: README.os2 os2/Changes perl.c
[one change was applied, as
d8c2d278168b862ff4120ad8e5887d37d31f858b]
Title: "make depend loop fix and minor OS/2 improvements to build process"
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Files: Makefile.SH hints/os2.sh os2/Makefile.SHs
Title: "Minor VMS patches"
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Msg-ID: <01ILCUO6XXTE000WFK@hmivax.humgen.upenn.edu>
Files: lib/ExtUtils/MM_VMS.pm vms/vmsish.h vms/descrip.mms vms/test.com
vms/vms.c vms/ext/filespec.t
Title: "[PATCH] Two un-disabled tests for VMS"
From: Dan Sugalski <sugalsd@lbcc.cc.or.us>
Msg-ID: <3.0.2.32.19970718095842.00879220@stargate.lbcc.cc.or.us>
Files: vms/test.com
Title: "fix substr fix (tests 27 etc)", "perl5.004_02 trial 1 available
(with substr bug and still some"
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>, Hugo van der Sanden
<hv@crypt.compulink.co.uk>, Jarkko Hietaniemi <jhi@iki.fi>
Msg-ID: <199707301759.SAA02899@crypt.compulink.co.uk>,
<199707302228.BAA18032@alpha.hut.fi>,
<199707310929.KAA06515@crypt.compulink.co.uk>,
<E0wtruH-0002JM-00@ursa.cus.cam.ac.uk>
Files: pp.c
Title: "Fwd: substr("foo", -1000)", "substr: warn if substring doesn't
intersect original at all"
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>, Jarkko Hietaniemi <jhi@iki.fi>
Msg-ID: <199707100655.JAA14924@alpha.hut.fi>,
<E0wm1JG-0000UY-00@taurus.cus.cam.ac.uk>
Files: pod/perlfunc.pod pp.c t/op/substr.t
[one change was applied, as
d9fdd1afe4b88705294e21dc4e070c42d3d9a4d8]
Title: "[PATCH] Changes for VMS 7.1 support"
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>, Dan Sugalski
<sugalsd@lbcc.cc.or.us>
Msg-ID: <01ILDXUH0J1W00026U@hmivax.humgen.upenn.edu>,
<3.0.2.32.19970718095935.0087a2d0@stargate.lbcc.cc.or.us>
Files: vms/sockadapt.h vms/config.vms vms/sockadapt.c
------ DOCUMENTATION ------
Title: "Document bug fix in localization of $1 etc."
From: Chip Salzenberg <salzench@nielsenmedia.com>
Files: pod/perldelta.pod
Title: "[BUG:PATCH] Missing semicolon message wrong in perldiag"
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Msg-ID: <E0welEn-0002vT-00@taurus.cus.cam.ac.uk>,
<E0wfRJU-0006Aw-00@taurus.cus.cam.ac.uk>
Files: pod/perldiag.pod
[one change was applied, as
702d120df290e0de1b21f167f7d0110b35ee2fef]
Title: "OK: perl <some_version> on <some_system> (corrected)", "enhancements
to perlbug -ok"
From: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>, Stephen McCamant <alias@mcs.com>
Msg-ID: <E0wukVt-0006Da-00@ursa.cus.cam.ac.uk>,
<E0wvMQl-00055y-00@ursa.cus.cam.ac.uk>,
<m0wv81x-000EYPC@alias-2.pr.mcs.net>
Files: utils/Makefile utils/perlbug.PL
Title: "perldoc doesn't grok Win32 UNC paths"
From: Warren Jones <wjones@tc.fluke.com>
Msg-ID: <97Jun17.184420pdt.35728-1@gateway.fluke.com>,
<97Jun18.165618pdt.35713-1@gateway.fluke.com>
Files: utils/perldoc.PL
[one change was applied, as
f72119fc50f0d88b02501ba41112f82ab99f0c3b]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Exporter.pm | 57 | ||||
-rw-r--r-- | lib/ExtUtils/Command.pm | 22 | ||||
-rw-r--r-- | lib/ExtUtils/Install.pm | 4 | ||||
-rw-r--r-- | lib/ExtUtils/Liblist.pm | 2 | ||||
-rw-r--r-- | lib/ExtUtils/MM_Unix.pm | 111 | ||||
-rw-r--r-- | lib/ExtUtils/MM_VMS.pm | 6 | ||||
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 32 | ||||
-rw-r--r-- | lib/ExtUtils/Mksymlists.pm | 24 | ||||
-rw-r--r-- | lib/FileHandle.pm | 6 | ||||
-rw-r--r-- | lib/IPC/Open3.pm | 2 | ||||
-rw-r--r-- | lib/Sys/Hostname.pm | 11 | ||||
-rw-r--r-- | lib/Term/ReadLine.pm | 2 | ||||
-rw-r--r-- | lib/Time/Local.pm | 10 | ||||
-rw-r--r-- | lib/UNIVERSAL.pm | 23 | ||||
-rw-r--r-- | lib/ftp.pl | 12 |
15 files changed, 256 insertions, 68 deletions
diff --git a/lib/Exporter.pm b/lib/Exporter.pm index a91014bbde..3f42e407e0 100644 --- a/lib/Exporter.pm +++ b/lib/Exporter.pm @@ -167,6 +167,15 @@ sub export { } } +sub export_to_level +{ + my $pkg = shift; + my ($level, $junk) = (shift, shift); # need to get rid of first arg + # we know it already. + my $callpkg = caller($level); + $pkg->export($callpkg, @_); +} + sub import { my $pkg = shift; my $callpkg = caller($ExportLevel); @@ -174,6 +183,7 @@ sub import { } + # Utility functions sub _push_tags { @@ -348,6 +358,53 @@ You can say C<BEGIN { $Exporter::Verbose=1 }> to see how the specifications are being processed and what is actually being imported into modules. +=head2 Exporting without using Export's import method + +Exporter has a special method, 'export_to_level' which is used in situations +where you can't directly call Export's import method. The export_to_level +method looks like: + +MyPackage->export_to_level($where_to_export, @what_to_export); + +where $where_to_export is an integer telling how far up the calling stack +to export your symbols, and @what_to_export is an array telling what +symbols *to* export (usually this is @_). + +For example, suppose that you have a module, A, which already has an +import function: + +package A; + +@ISA = qw(Exporter); +@EXPORT_OK = qw ($b); + +sub import +{ + $A::b = 1; # not a very useful import method +} + +and you want to Export symbol $A::b back to the module that called +package A. Since Exporter relies on the import method to work, via +inheritance, as it stands Exporter::import() will never get called. +Instead, say the following: + +package A; +@ISA = qw(Exporter); +@EXPORT_OK = qw ($b); + +sub import +{ + $A::b = 1; + A->export_to_level(1, @_); +} + +This will export the symbols one level 'above' the current package - ie: to +the program or module that used package A. + +Note: Be careful not to modify '@_' at all before you call export_to_level +- or people using your package will get very unexplained results! + + =head2 Module Version Checking The Exporter module will convert an attempt to import a number from a diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index bdf32d4218..d37d0f3c25 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -10,7 +10,7 @@ require Exporter; use vars qw(@ISA @EXPORT $VERSION); @ISA = qw(Exporter); @EXPORT = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f); -$VERSION = '1.00'; +$VERSION = '1.01'; =head1 NAME @@ -18,16 +18,16 @@ ExtUtils::Command - utilities to replace common UNIX commands in Makefiles etc. =head1 SYNOPSIS - perl -MExtUtils::command -e cat files... > destination - perl -MExtUtils::command -e mv source... destination - perl -MExtUtils::command -e cp source... destination - perl -MExtUtils::command -e touch files... - perl -MExtUtils::command -e rm_f file... - perl -MExtUtils::command -e rm_rf directories... - perl -MExtUtils::command -e mkpath directories... - perl -MExtUtils::command -e eqtime source destination - perl -MExtUtils::command -e chmod mode files... - perl -MExtUtils::command -e test_f file + perl -MExtUtils::Command -e cat files... > destination + perl -MExtUtils::Command -e mv source... destination + perl -MExtUtils::Command -e cp source... destination + perl -MExtUtils::Command -e touch files... + perl -MExtUtils::Command -e rm_f file... + perl -MExtUtils::Command -e rm_rf directories... + perl -MExtUtils::Command -e mkpath directories... + perl -MExtUtils::Command -e eqtime source destination + perl -MExtUtils::Command -e chmod mode files... + perl -MExtUtils::Command -e test_f file =head1 DESCRIPTION diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index 92843969d4..ff5dbf1517 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -1,7 +1,7 @@ package ExtUtils::Install; -$VERSION = substr q$Revision: 1.16 $, 10; -# $Date: 1996/12/17 00:31:26 $ +$VERSION = substr q$Revision: 1.19 $, 10; +# $Date: 1997/08/01 08:39:37 $ use Exporter; use Carp (); diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 90186d8267..fed25ae13b 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -2,7 +2,7 @@ package ExtUtils::Liblist; use vars qw($VERSION); # Broken out of MakeMaker from version 4.11 -$VERSION = substr q$Revision: 1.2201 $, 10; +$VERSION = substr q$Revision: 1.25 $, 10; use Config; use Cwd 'cwd'; diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index d189898c98..7669167d68 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -8,8 +8,8 @@ use strict; use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Verbose %pm %static $Xsubpp_Version); -$VERSION = substr q$Revision: 1.114 $, 10; -# $Id: MM_Unix.pm,v 1.113 1997/02/11 21:54:09 k Exp $ +$VERSION = substr q$Revision: 1.118 $, 10; +# $Id: MM_Unix.pm,v 1.118 1997/08/01 09:42:52 k Exp $ Exporter::import('ExtUtils::MakeMaker', qw( $Verbose &neatvalue)); @@ -181,6 +181,7 @@ sub ExtUtils::MM_Unix::export_list ; sub ExtUtils::MM_Unix::extliblist ; sub ExtUtils::MM_Unix::file_name_is_absolute ; sub ExtUtils::MM_Unix::find_perl ; +sub ExtUtils::MM_Unix::fixin ; sub ExtUtils::MM_Unix::force ; sub ExtUtils::MM_Unix::guess_name ; sub ExtUtils::MM_Unix::has_link_code ; @@ -1103,6 +1104,86 @@ specified by @ExtUtils::MakeMaker::MM_Sections. =over 2 +=item fixin + +Inserts the sharpbang or equivalent magic number to a script + +=cut + +sub fixin { # stolen from the pink Camel book, more or less + my($self,@files) = @_; + my($does_shbang) = $Config::Config{'sharpbang'} =~ /^\s*\#\!/; + my($file,$interpreter); + for $file (@files) { + local(*FIXIN); + local(*FIXOUT); + open(FIXIN, $file) or Carp::croak "Can't process '$file': $!"; + local $/ = "\n"; + chomp(my $line = <FIXIN>); + next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file. + # Now figure out the interpreter name. + my($cmd,$arg) = split ' ', $line, 2; + $cmd =~ s!^.*/!!; + + # Now look (in reverse) for interpreter in absolute PATH (unless perl). + if ($cmd eq "perl") { + $interpreter = $Config{perlpath}; + } else { + my(@absdirs) = reverse grep {$self->file_name_is_absolute} $self->path; + $interpreter = ''; + my($dir); + foreach $dir (@absdirs) { + if ($self->maybe_command($cmd)) { + warn "Ignoring $interpreter in $file\n" if $Verbose && $interpreter; + $interpreter = $self->catfile($dir,$cmd); + } + } + } + # Figure out how to invoke interpreter on this machine. + + my($shb) = ""; + if ($interpreter) { + print STDOUT "Changing sharpbang in $file to $interpreter" if $Verbose; + if ($does_shbang) { + $shb .= "$Config{'sharpbang'}$interpreter"; + $shb .= ' ' . $arg if defined $arg; + $shb .= "\n"; + } + $shb .= qq{ +eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' + if \$running_under_some_shell; +}; + } else { + warn "Can't find $cmd in PATH, $file unchanged" + if $Verbose; + next; + } + + unless ( rename($file, "$file.bak") ) { + warn "Can't modify $file"; + next; + } + unless ( open(FIXOUT,">$file") ) { + warn "Can't create new $file: $!\n"; + next; + } + my($dev,$ino,$mode) = stat FIXIN; + $mode = 0755 unless $dev; + chmod $mode, $file; + + # Print out the new #! line (or equivalent). + local $\; + undef $/; + print FIXOUT $shb, <FIXIN>; + close FIXIN; + close FIXOUT; + unlink "$file.bak"; + } continue { + chmod 0755, $file or die "Can't reset permissions for $file: $!\n"; + system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';; + } +} + =item force (o) Just writes FORCE: @@ -1280,7 +1361,6 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) # my $fh = new FileHandle; local *FH; my($ispod)=0; - # one day test, if $/ can be set to '' safely (is the bug fixed that was in 5.001m?) # if ($fh->open("<$name")) { if (open(FH,"<$name")) { # while (<$fh>) { @@ -1297,7 +1377,9 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) $ispod = 1; } if( $ispod ) { - $manifypods{$name} = $self->catfile('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)'); + $manifypods{$name} = + $self->catfile('$(INST_MAN1DIR)', + basename($name).'.$(MAN1EXT)'); } } } @@ -1901,23 +1983,27 @@ sub installbin { $fromto{$from}=$to; } @to = values %fromto; - push(@m, " + push(@m, qq{ EXE_FILES = @{$self->{EXE_FILES}} +FIXIN = \$(PERL) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) -MExtUtils::MakeMaker \\ + -e "MY->fixin(shift)" + all :: @to $self->{NOECHO}\$(NOOP) realclean :: $self->{RM_F} @to -"); +}); while (($from,$to) = each %fromto) { last unless defined $from; my $todir = dirname($to); push @m, " -$to: $from $self->{MAKEFILE} ".$self->catfile($todir,'.exists')." +$to: $from $self->{MAKEFILE} " . $self->catdir($todir,'.exists') . " $self->{NOECHO}$self->{RM_F} $to $self->{CP} $from $to + \$(FIXIN) $to "; } join "", @m; @@ -2431,18 +2517,21 @@ sub parse_version { $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; next if $inpod; chop; - next unless /\$(([\w\:\']*)\bVERSION)\b.*\=/; + # next unless /\$(([\w\:\']*)\bVERSION)\b.*\=/; + next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; my $eval = qq{ package ExtUtils::MakeMaker::_version; no strict; - \$$1=undef; do { + local $1$2; + \$$2=undef; do { $_ - }; \$$1 + }; \$$2 }; local($^W) = 0; - $result = eval($eval) || 0; + $result = eval($eval); die "Could not eval '$eval' in $parsefile: $@" if $@; + $result = "undef" unless defined $result; last; } close FH; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index da2a7638ca..dc3b4ceca6 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -96,7 +96,7 @@ sub fixpath { } my($fixedpath,$prefix,$name); - if ($path =~ m#^\$\(.+\)$# || $path =~ m#[/:>\]]#) { + if ($path =~ m#^\$\([^\)]+\)$# || $path =~ m#[/:>\]]#) { if ($force_path or $path =~ /(?:DIR\)|\])$/) { $fixedpath = vmspath($self->eliminate_macros($path)); } @@ -105,7 +105,9 @@ sub fixpath { } } elsif ((($prefix,$name) = ($path =~ m#^\$\(([^\)]+)\)(.+)#)) && $self->{$prefix}) { - my($vmspre) = vmspath($self->eliminate_macros("\$($prefix)")) || ''; # is it a dir or just a name? + my($vmspre) = $self->eliminate_macros("\$($prefix)"); + # is it a dir or just a name? + $vmspre = ($vmspre =~ m|/| or $prefix =~ /DIR$/) ? vmspath($vmspre) : ''; $fixedpath = ($vmspre ? $vmspre : $self->{$prefix}) . $name; $fixedpath = vmspath($fixedpath) if $force_path; } diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 6d1746c31f..5511e3d1e4 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -2,10 +2,10 @@ BEGIN {require 5.002;} # MakeMaker 5.17 was the last MakeMaker that was compatib package ExtUtils::MakeMaker; -$Version = $VERSION = "5.4002"; +$Version = $VERSION = "5.42"; $Version_OK = "5.17"; # Makefiles older than $Version_OK will die # (Will be checked from MakeMaker version 4.13 onwards) -($Revision = substr(q$Revision: 1.211 $, 10)) =~ s/\s+$//; +($Revision = substr(q$Revision: 1.216 $, 10)) =~ s/\s+$//; @@ -1157,6 +1157,11 @@ Ref to array of *.c file names. Initialised from a directory scan and the values portion of the XS attribute hash. This is not currently used by MakeMaker but may be handy in Makefile.PLs. +=item CCFLAGS + +String that will be included in the compiler call command line between +the arguments INC and OPTIMIZE. + =item CONFIG Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from @@ -1257,6 +1262,10 @@ Perl binary able to run this extension. Ref to array of *.h file names. Similar to C. +=item IMPORTS + +IMPORTS is only used on OS/2. + =item INC Include file dirs eg: C<"-I/usr/5include -I/path/to/inc"> @@ -1564,15 +1573,17 @@ routine requires that the file named by VERSION_FROM contains one single line to compute the version number. The first line in the file that contains the regular expression - /\$(([\w\:\']*)\bVERSION)\b.*\=/ + /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/ will be evaluated with eval() and the value of the named variable B<after> the eval() will be assigned to the VERSION attribute of the MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; - ( $VERSION ) = '$Revision: 1.211 $ ' =~ /\$Revision:\s+([^\s]+)/; + *VERSION = \'1.01'; + ( $VERSION ) = '$Revision: 1.216 $ ' =~ /\$Revision:\s+([^\s]+)/; $FOO::VERSION = '1.10'; + *FOO::VERSION = \'1.11'; but these will fail: @@ -1580,9 +1591,16 @@ but these will fail: local $VERSION = '1.02'; local $FOO::VERSION = '1.30'; -The file named in VERSION_FROM is added as a dependency to Makefile to -guarantee, that the Makefile contains the correct VERSION macro after -a change of the file. +The file named in VERSION_FROM is not added as a dependency to +Makefile. This is not really correct, but it would be a major pain +during development to have to rewrite the Makefile for any smallish +change in that file. If you want to make sure that the Makefile +contains the correct VERSION macro after any change of the file, you +would have to do something like + + depend => { Makefile => '$(VERSION_FROM)' } + +See attribute C<depend> below. =item XS diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 73dc81d069..350136455f 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -7,7 +7,7 @@ use Exporter; use vars qw( @ISA @EXPORT $VERSION ); @ISA = 'Exporter'; @EXPORT = '&Mksymlists'; -$VERSION = substr q$Revision: 1.13 $, 10; +$VERSION = substr q$Revision: 1.16 $, 10; sub Mksymlists { my(%spec) = @_; @@ -106,16 +106,28 @@ sub _write_win32 { open(DEF,">$data->{FILE}.def") or croak("Can't create $data->{FILE}.def: $!\n"); - print DEF "LIBRARY $data->{DLBASE}\n"; + # put library name in quotes (it could be a keyword, like 'Alias') + print DEF "LIBRARY \"$data->{DLBASE}\"\n"; print DEF "CODE LOADONCALL\n"; print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n"; print DEF "EXPORTS\n "; + my @syms; + # Export public symbols both with and without underscores to + # ensure compatibility between DLLs from different compilers + # NOTE: DynaLoader itself only uses the names without underscores, + # so this is only to cover the case when the extension DLL may be + # linked to directly from C. GSAR 97-07-10 if ($Config::Config{'cc'} =~ /^bcc/i) { - for (@{$data->{DL_VARS}}) { $_ = "$_ = _$_" } - for (@{$data->{FUNCLIST}}) { $_ = "$_ = _$_" } + for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) { + push @syms, "_$_", "$_ = _$_"; + } } - print DEF join("\n ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}}; - print DEF join("\n ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}}; + else { + for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) { + push @syms, "$_", "_$_ = $_"; + } + } + print DEF join("\n ",@syms, "\n") if @syms; if (%{$data->{IMPORTS}}) { print DEF "IMPORTS\n"; my ($name, $exp); diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm index 1dc699c85b..0264b61f15 100644 --- a/lib/FileHandle.pm +++ b/lib/FileHandle.pm @@ -94,9 +94,9 @@ sub pipe { } # Rebless standard file handles -bless *STDIN{IO}, "FileHandle"; -bless *STDOUT{IO}, "FileHandle"; -bless *STDERR{IO}, "FileHandle"; +bless *STDIN{IO}, "FileHandle" if ref *STDIN{IO} eq "IO::Handle"; +bless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle"; +bless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle"; 1; diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm index 43caa03763..f6d45cee85 100644 --- a/lib/IPC/Open3.pm +++ b/lib/IPC/Open3.pm @@ -20,7 +20,7 @@ IPC::Open3, open3 - open a process for reading, writing, and error handling =head1 SYNOPSIS - $pid = open3(\*WTRFH, \*RDRFH, \*ERRFH + $pid = open3(\*WTRFH, \*RDRFH, \*ERRFH, 'some cmd and args', 'optarg', ...); =head1 DESCRIPTION diff --git a/lib/Sys/Hostname.pm b/lib/Sys/Hostname.pm index cbfd943591..d23310a5af 100644 --- a/lib/Sys/Hostname.pm +++ b/lib/Sys/Hostname.pm @@ -39,8 +39,7 @@ sub hostname { if ($^O eq 'VMS') { # method 2 - no sockets ==> return DECnet node name - eval {local $SIG{'__DIE__'}; - ($host) = gethostbyname('me')}; # returns 'me' on most systems + eval { local $SIG{__DIE__}; $host = (gethostbyname('me'))[0] }; if ($@) { return $host = $ENV{'SYS$NODE'}; } # method 3 - has someone else done the job already? It's common for the @@ -70,7 +69,7 @@ sub hostname { # method 2 - syscall is preferred since it avoids tainting problems eval { - local $SIG{'__DIE__'}; + local $SIG{__DIE__}; { package main; require "syscall.ph"; @@ -81,19 +80,19 @@ sub hostname { # method 3 - trusty old hostname command || eval { - local $SIG{'__DIE__'}; + local $SIG{__DIE__}; $host = `(hostname) 2>/dev/null`; # bsdish } # method 4 - sysV uname command (may truncate) || eval { - local $SIG{'__DIE__'}; + local $SIG{__DIE__}; $host = `uname -n 2>/dev/null`; ## sysVish } # method 5 - Apollo pre-SR10 || eval { - local $SIG{'__DIE__'}; + local $SIG{__DIE__}; ($host,$a,$b,$c,$d)=split(/[:\. ]/,`/com/host`,6); } diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm index a9df784d79..b6923dd1e7 100644 --- a/lib/Term/ReadLine.pm +++ b/lib/Term/ReadLine.pm @@ -240,7 +240,7 @@ sub OUT { shift->[1] } sub MinLine { undef } sub Attribs { {} } -my %features = (tkRunning => 1, ornaments => 1, newTTY => 1); +my %features = (tkRunning => 1, ornaments => 1, 'newTTY' => 1); sub Features { \%features } package Term::ReadLine; # So late to allow the above code be defined? diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm index 8d3e49a4a1..d2d70dab20 100644 --- a/lib/Time/Local.pm +++ b/lib/Time/Local.pm @@ -59,9 +59,17 @@ sub timegm { sub timelocal { my $t = &timegm; + my $tt = $t; my (@lt) = localtime($t); my (@gt) = gmtime($t); + if ($t < $DAY and ($lt[5] >= 70 or $gt[5] >= 70 )) { + # Wrap error, too early a date + # Try a safer date + $tt = $DAY; + @lt = localtime($tt); + @gt = gmtime($tt); + } my $tzsec = ($gt[1] - $lt[1]) * $MIN + ($gt[2] - $lt[2]) * $HR; @@ -80,7 +88,7 @@ sub timelocal { $time = $t + $tzsec; return -1 if $cheat<0 and $^O ne 'VMS'; - @test = localtime($time); + @test = localtime($time + ($tt - $t)); $time -= $HR if $test[2] != $_[2]; $time; } diff --git a/lib/UNIVERSAL.pm b/lib/UNIVERSAL.pm index 6d832c4bea..dc02423029 100644 --- a/lib/UNIVERSAL.pm +++ b/lib/UNIVERSAL.pm @@ -1,7 +1,10 @@ package UNIVERSAL; +# UNIVERSAL should not contain any extra subs/methods beyond those +# that it exists to define. The use of Exporter below is a historical +# accident that should be fixed sometime. require Exporter; -@ISA = qw(Exporter); +*import = \&Exporter::import; @EXPORT_OK = qw(isa can); 1; @@ -13,12 +16,11 @@ UNIVERSAL - base class for ALL classes (blessed references) =head1 SYNOPSIS - use UNIVERSAL qw(isa); - - $yes = isa($ref, "HASH"); $io = $fd->isa("IO::Handle"); $sub = $obj->can('print'); + $yes = UNIVERSAL::isa($ref, "HASH"); + =head1 DESCRIPTION C<UNIVERSAL> is the base class which all bless references will inherit from, @@ -54,11 +56,11 @@ C<VERSION> can be called as either a static or object method call. =back -C<UNIVERSAL> also optionally exports the following subroutines +The C<isa> and C<can> methods can also be called as subroutines =over 4 -=item isa ( VAL, TYPE ) +=item UNIVERSAL::isa ( VAL, TYPE ) C<isa> returns I<true> if the first argument is a reference and either of the following statements is true. @@ -76,7 +78,7 @@ C<VAL> is a reference to a C<TYPE> of perl variable (er 'HASH') =back -=item can ( VAL, METHOD ) +=item UNIVERSAL::can ( VAL, METHOD ) If C<VAL> is a blessed reference which has a method called C<METHOD>, C<can> returns a reference to the subroutine. If C<VAL> is not @@ -85,4 +87,11 @@ I<undef> is returned. =back +These subroutines should I<not> be imported via S<C<use UNIVERSAL qw(...)>>. +If you want simple local access to them you can do + + *isa = \&UNIVERSAL::isa; + +to import isa into your package. + =cut diff --git a/lib/ftp.pl b/lib/ftp.pl index e671348105..fd78162a40 100644 --- a/lib/ftp.pl +++ b/lib/ftp.pl @@ -88,15 +88,9 @@ # Initial revision # -eval { require 'chat2.pl' }; -die qq{$@ -The obsolete and problematic chat2.pl library has been removed from the -Perl distribution at the request of it's author. You can either get a -copy yourself or, preferably, fetch the new and much better Net::FTP -package from a CPAN ftp site. -} if $@ && $@ =~ /locate chat2.pl/; -die $@ if $@; -eval "require 'socket.ph'" || eval "require 'sys/socket.ph'" || die "socket.ph missing: $!\n"; +require 'chat2.pl'; # into main +eval "require 'socket.ph'" || eval "require 'sys/socket.ph'" + || die "socket.ph missing: $!\n"; package ftp; |