Must now be written fully qualified: CORE::dump().
Adapt tests that previously warned, plus adapt one test that incidentally used dump().
For: RT # 133584
subroutine or package before the current location. You can use an empty
"sub foo;" or "package FOO;" to enter a "forward" declaration.
-=item dump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30
+=item dump() must be written as CORE::dump() as of Perl 5.30
-(D deprecated, misc) You used the obsolescent C<dump()> built-in function,
-without fully qualifying it as C<CORE::dump()>. Maybe it's a typo.
-
-Use of a unqualified C<dump()> was deprecated in Perl 5.8.0, and this
-will not be available in Perl 5.30.
+(F) You used the obsolete C<dump()> built-in function. That was deprecated in
+Perl 5.8.0. As of Perl 5.30 it must be written in fully qualified format:
+C<CORE::dump()>.
See L<perlfunc/dump>.
resulting confusion by Perl.
This function is now largely obsolete, mostly because it's very hard to
-convert a core file into an executable. That's why you should now invoke
-it as C<CORE::dump()> if you don't want to be warned against a possible
-typo.
+convert a core file into an executable. As of Perl 5.30, it must be invoked
+as C<CORE::dump()>.
Unlike most named operators, this has the same precedence as assignment.
It is also exempt from the looks-like-a-function rule, so
That's what I<you> think!
- What's C<dump()> for?
+ What's C<CORE::dump()> for?
X<C<chmod> and C<unlink()> Under Different Operating Systems>
This speeds startup at the expense of some disk space (which you
can minimize by stripping the executable). (Still, a "hello world"
executable comes out to about 200K on my machine.) If you want to
-execute a portion of your program before dumping, use the dump()
-operator instead. Note: availability of I<undump> is platform
+execute a portion of your program before dumping, use the C<CORE::dump()>
+function instead. Note: availability of I<undump> is platform
specific and may not be available for a specific port of Perl.
=item B<-U>
# NAME dump with computed label
no warnings 'deprecated';
my $label = "foo";
-dump $label;
+CORE::dump $label;
EXPECT
Can't find label foo at - line 3.
########
(Missing operator before p0?)
syntax error at - line 2, near "2p0"
Execution of - aborted due to compilation errors.
+########
+# NAME dump() must be written as CORE::dump() as of Perl 5.30
+BEGIN { $^C = 1; }
+dump;
+CORE::dump;
+EXPECT
+dump() must be written as CORE::dump() as of Perl 5.30 at - line 2.
$a = 0037777777777 ;
$a = 0047777777777 ;
- dump() better written as CORE::dump()
-
Use of /c modifier is meaningless without /g
Use of /c modifier is meaningless in s///
Integer overflow in octal number at - line 11.
########
# toke.c
-BEGIN { $^C = 1; }
-dump;
-CORE::dump;
-EXPECT
-dump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30 at - line 3.
-- syntax OK
-########
-# toke.c
-BEGIN { $^C = 1; }
-no warnings 'deprecated';
-dump;
-CORE::dump;
-EXPECT
-- syntax OK
-########
-# toke.c
-BEGIN { $^C = 1; }
-no warnings 'deprecated';
-use warnings 'misc';
-dump;
-CORE::dump;
-EXPECT
-dump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30 at - line 5.
-- syntax OK
-########
-# toke.c
-use warnings 'misc';
-use subs qw/dump/;
-sub dump { print "no warning for overridden dump\n"; }
-dump;
-EXPECT
-no warning for overridden dump
-########
-# toke.c
use warnings 'ambiguous';
"@mjd_previously_unused_array";
no warnings 'ambiguous';
# Depending on how perl is built, there may be extraneous stuff on stderr
# such as "Aborted", which isn't caught by the '2>&1' that
-# fresh_perl_like() does. So execute each dump() in a sub-process.
+# fresh_perl_like() does. So execute each CORE::dump() in a sub-process.
#
# In detail:
# fresh_perl_like() ends up doing a `` which invokes a shell with 2 args:
#
# "sh", "-c", "perl /tmp/foo 2>&1"
#
-# When the perl process coredumps after calling dump(), the parent
+# When the perl process coredumps after calling CORE::dump(), the parent
# sh sees that the exit of the child flags a coredump and so prints
# something like the following to stderr:
#
else {
# child
print qq(A);
- dump;
+ CORE::dump;
print qq(B);
}
PROG
-fresh_perl_like(<<'PROG', qr/A(?!B\z)/, {}, "dump with label quits");
-BEGIN {$SIG {__WARN__} = sub {1;}}
+fresh_perl_like(<<'PROG', qr/A(?!B\z)/, {}, "CORE::dump with label quits"); BEGIN {$SIG {__WARN__} = sub {1;}}
++$|;
my $pid = fork;
die "fork: $!\n" unless defined $pid;
}
else {
print qq(A);
- dump foo;
+ CORE::dump foo;
foo:
print qq(B);
}
else { /* no override */
tmp = -tmp;
if (tmp == KEY_dump) {
- Perl_ck_warner_d(aTHX_ packWARN2(WARN_MISC,WARN_DEPRECATED),
- "dump() better written as CORE::dump(). "
- "dump() will no longer be available "
- "in Perl 5.30");
+ Perl_croak(aTHX_ "dump() must be written as CORE::dump() as of Perl 5.30");
}
gv = NULL;
gvp = 0;