| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using vars pragma is discouraged and has been superseded
by 'our' declarations available in Perl v5.6.0 or later.
Additionally using 'vars' pragma increase the memory consumption of a
program by about 700 kB for no good reason.
This commit is about replacing the usage of 'vars' pragma
by 'our' in blead where it makes sense. ( leaving 'cpan' directory
outside of the scope )
-- using vars
perl -e 'use vars qw(@ISA $AUTOLOAD $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 2588 kB
-- using our instead
perl -e 'our (@ISA, $AUTOLOAD, $VERSION); print qx{grep RSS /proc/$$/status} '
VmRSS: 1864 kB
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a more refined and accurate solution for removing
'.' from @INC while reducing the false positives.
The following explanation is roughly what is avaiable in the code
comments. If you stumble upon this and feel like the commit message
or the comments are not helpful enough, please introduce another
commit that adds more explanation or improve the code comments
(or both).
Using
if ($INC[-1] eq '.' && %{"$base\::"})
We decide that:
The package already exists => this an optional load
And: there is a dot at the end of @INC => we want to hide it
However: we only want to hide it during our *own* require()
(i.e. without affecting nested require()s).
So we add a hook to @INC whose job is to hide the dot, but which
first checks checks the callstack depth, because within nested
require()s the callstack is deeper.
Since CORE::GLOBAL::require makes it unknowable in advance what
the exact relevant callstack depth will be, we have to record it
inside a hook. So we put another hook just for that at the front
of @INC, where it's guaranteed to run -- immediately.
The dot-hiding hook does its job by sitting directly in front of
the dot and removing itself from @INC when reached. This causes
the dot to move up one index in @INC, causing the loop inside
pp_require() to skip it.
Loaded coded may disturb this precise arrangement, but that's OK
because the hook is inert by that time. It is only active during
the top-level require(), when @INC is in our control. The only
possible gotcha is if other hooks already in @INC modify @INC in
some way during that initial require().
Note that this jiggery hookery works just fine recursively: if
a module loaded via base.pm uses base.pm itself, there will be
one pair of hooks in @INC per base::import call frame, but the
pairs from different nestings do not interfere with each other.
(cherry picked from commit 571931bfa1120564fe207965f9ec2ea0f8bbbb8a)
[This is a forward-port, with improved commit message by Sawyer X
<xsawyerx@cpan.org>, of the commit that was cherry-picked into
maint-5.22 and maint-5.24 as commits a93da9a38c and 1afa289000
respectively.]
|
| |
|
|
|
|
| |
follow-up to the previous commit's reverting of base.pm @INC changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts:
458470f62360040dcd4b5a55c8ba07503e1af5fc
362f3f748cb84934a072fadbfb8b51090e2f9afe
bca552795994a553e07b38a6f82a233533919926
and the base.pm part of
8901ddee94b1bc3764b4278d1cb26bed30bc2605
This commit removes all the recent stuff that made base.pm localise
@INC and remove a trailing '.'.
This is because perl 5.26.0 will be released with '.' in @INC disabled by
default.
See RT #128769.
|
|
|
|
|
| |
The new version is based on one written by Chris Travers, polished
up a bit by yours truly.
|
|
|
|
|
|
|
| |
As Zefram pointed out in
<https://rt.perl.org/Ticket/Display.html?id=128769#txn-1414015>,
having inconsistent behaviour is going to cause more problems
than solves.
|
|
|
|
|
|
|
|
|
|
|
| |
• Localise @INC only if necessary.
• Don’t mention '.' in the @INC list in the error message, since it
was not in the @INC that was searched (this is accomplished by local-
ising @INC in the same scope as the error).
• If a file exists that would have been loaded had '.' not been
ignored, mention it and suggest ‘use lib’.
• Use the same number of closing as opening parentheses in the
error message.
|
|
|
|
|
|
| |
This is my quick-and-dirty script:
find dist -print0 | xargs -0 perl -pi -e 'BEGIN { %map = split " ", join "", `cat pb2rt.txt` } s/(?<!\d)\d{8}\.\d{3}(?!\d)/$& (#$map{$&})/g'
|
| |
|
|
|
|
|
|
| |
I didn't update base.pm since that seems more likely to be loading
modules *expected* to be in the current directory. Opinions
welcome.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
...eliminates some unneeded files, adds a Makefile.PL (for the
INSTALLDIRS-picking behavior).
|
| |
|
|
|
|
| |
Checking the location called from broke require overrides.
|
| |
|
|
|
|
| |
Tony Cook: update MANIFEST
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
• Actually give an example of a typed lexical.
• Also show the syntax parenthetically in the pod, since the phrase
‘typed lexical’ is not exactly well known.
• Don’t use dev version numbers.
• Don’t talk about pseudo-hashes so pervasively, as the fact that they
are used is more an implementation detail now than a feature (except
for phash).
• If we talk about restricted hashes, we should link to Hash::Util.
• -w is not the only way to turn warnings on.
Also mention in perlfunc that ‘my __PACKAGE__’ and ‘my CONSTANT’ work,
so that the only mentions are not in perl561delta and Lexical::Types.
|
| |
|
|
|
|
|
|
|
|
| |
exists"
This reverts commit c4f21d8bae2372c750ff63b7e5df47996baa1f39.
This broke tests in Moose.
|
| |
|
| |
|
|
|
|
|
| |
(this wasn't found earlier because this test file is only
run with perls <= 5.8.x)
|
|
|
|
| |
and improve diagnostics
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tracking modules loaded by base.pm to avoid reloading them means
that any module that wishes to force a reload can't just modify
%INC but must also interact with base.pm to clear its cache.
Removing the module-loaded checks have minimal impact. The internal
call to require() is a NOP for a loaded module. For an internal
package, the require() will fail with the same error message as
before, which base.pm then ignores. Tracking modules loaded to avoid
this slight extra overhead is not worth the complexity for other
modules that wish to manipulate %INC.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, base.pm modified the $VERSION of modules it loaded to
the string "-1, set by base.pm". This is not a valid lax version
string and thus could not be parsed by version.pm. (It is also an
encapsulation violation, as it modifies a global in another package.)
This patch removes the $VERSION modification code entirely and uses
a private hash to track which modules base.pm has successfully loaded.
This also eliminates a subtle bug in how base.pm was checking for
the existence of a package's VERSION scalar.
[Though the final mechanism is different, thank you to John Peacock for
proposing the initial patch to eliminate the "-1..." code from base.pm]
|
| |
|
|
|
|
| |
(actually 79, so ‘comfortably within’ 80 columns)
|
| |
|
|
|
|
| |
I wonder how many other things a604c75 broke....
|
| |
|
|
|
|
|
|
| |
The "inherit from yourself" is triggered by
C<package Foo; use base 'Foo';> not C<use Foo; use base 'Foo';>
as stated in the documentation.
|
| |
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81888]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81888 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
| |
It's there for Rafael's convenience when doing CPAN releases, as there's no
separate base repository.
|
|
|
|
| |
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
|
| |
|
| |
|
|
|