Subject: | v5.010 say |
Patch and tests to try to match v5010 say(). Does not flag the following:
use Foo "say"; say "Bar";
use Foo qw/ say /; say "Bar";
sub say; say "Bar";
sub say { print @_, "\n" } say "Bar";
Not much can be done about this though:
use AutoExportedSay; say "Foo";
Subject: | v5010_say.t |
#!/usr/bin/perl -w
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
use Test::More;
#use version;
use Perl::MinimumVersion;
my @examples_not=(
q{use Foo "say"; say "Bar"},
q{use Foo qw/ say /; say "Bar"},
q{sub say; say "Bar"},
q{sub say { print @_, "\n" } say "Bar"},
);
my @examples_yes=(
q{say "Foo"},
q{use AutoExportedSay; say "Foo"},
);
plan tests =>(@examples_not+@examples_yes);
foreach my $example (@examples_not) {
my $p = Perl::MinimumVersion->new(\$example);
is( $p->_perl_5010_say, '', $example )
or do { diag "\$\@: $@" if $@ };
}
foreach my $example (@examples_yes) {
my $p = Perl::MinimumVersion->new(\$example);
ok( $p->_perl_5010_say, $example )
or do { diag "\$\@: $@" if $@ };
}
Subject: | patch |
Message body not shown because it is not plain text.