-use warnings; no warnings 'deprecated';
+use warnings; no warnings 'experimental::lexical_topic';
use strict;
use Test::More tests => 4;
-use warnings; no warnings 'deprecated';
+use warnings; no warnings 'deprecated', 'experimental::lexical_topic';
use strict;
BEGIN {
-use warnings; no warnings 'deprecated';
+use warnings; no warnings 'deprecated', 'experimental::lexical_topic';
use strict;
use Test::More tests => 18;
-use warnings; no warnings 'deprecated';
+use warnings; no warnings 'deprecated', 'experimental::lexical_topic';
use strict;
use Test::More tests => 12;
# works in all cases.
undef $_;
{
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = $in;
is &{"CORE::$o"}(), $out, "&$o with no args uses lexical \$_";
}
my $r;
$r = sub {
if($_[0]) {
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = $in;
is &{"CORE::$o"}(), $out,
"&$o with no args uses the right lexical \$_ under recursion";
}
};
&$r(0);
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = $in;
eval {
is "CORE::$o"->(), $out, "&$o with the right lexical \$_ in an eval"
my $warnings;
local $SIG{__WARN__} = sub { ++$warnings };
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = 'Phoo';
ok &mymkdir(), '&mkdir';
like <*>, qr/^phoo(.DIR)?\z/i, 'mkdir works with implicit $_';
END
{
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = qq($Perl -le "print 'ok'");
is( readpipe, "ok\n", 'readpipe default argument' );
}
$_ = 'lfrulb';
{
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = 'blurfl';
ok(mkdir);
ok(-d);
}
use strict;
-no warnings 'misc', 'deprecated';
+no warnings 'misc', 'experimental::lexical_topic';
$_ = 'global';
is($_, 'global', '$_ initial value');
BEGIN {
# Can’t do ‘no warnings’ with CORE::GLOBAL::require overridden. :-)
CORE::require warnings;
- unimport warnings 'deprecated';
+ unimport warnings 'experimental::lexical_topic';
}
my $_ = 'bar.pm';
require;
{
# Lexical $_.
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
sub blurp { my $_ = shift; reverse }
is(blurp("foo"), "oof", 'reversal of default variable in function');
my $First = ucfirst $first;
$_ = "bambam";
foreach my $flint (@stones) {
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
state $_ = $flint;
is $_, $first, 'state $_';
ok /$first/, '/.../ binds to $_';
sub check_outside1 { is($_, "inside", "\$_ is not lexically scoped") }
{
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = "outside";
given("inside") { check_outside2() }
sub check_outside2 {
# Make sure it still works with a lexical $_:
{
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_;
my $test = "explicit comparison with lexical \$_";
my $twenty_five = 25;
{
my $first = 1;
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_;
for (1, "two") {
when ("two") {
{
my $first = 1;
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_;
for $_ (1, "two") {
when ("two") {
{
my $first = 1;
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
for my $_ (1, "two") {
when ("two") {
is($first, 0, "Lexical loop: second");
{
sub f1 {
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_;
given(3) {
return sub { $_ } # close over lexical $_
sub DESTROY { $d++ };
sub f2 {
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = 5;
given(bless [7]) {
::is($_->[0], 7, "is [7]");
{
# Test for keys in %+ and %-
my $message = 'Test keys in %+ and %-';
- no warnings 'uninitialized', 'deprecated';
+ no warnings 'uninitialized', 'deprecated', 'experimental::lexical_topic';
my $_ = "abcdef";
/(?<foo>a)|(?<foo>b)/;
is((join ",", sort keys %+), "foo", $message);
{
# length() on captures, the numbered ones end up in Perl_magic_len
- no warnings 'deprecated';
+ no warnings 'deprecated', 'experimental::lexical_topic';
my $_ = "aoeu \xe6var ook";
/^ \w+ \s (?<eek>\S+)/x;
{
my $message = '$REGMARK in replacement; Bug 49190';
our $REGMARK;
- no warnings 'deprecated';
+ no warnings 'experimental::lexical_topic';
my $_ = "A";
ok(s/(*:B)A/$REGMARK/, $message);
is($_, "B", $message);
is $output, "5\n1: 5\n2: 5\n", '$a_match_var =~ /$qr/';
}
-no warnings 'deprecated';
+no warnings 'experimental::lexical_topic';
for my $_($'){
my $output = '';
my $rx = qr/o/;