In general, a strong keyword 'foo' will get deparsed as plain 'foo'
rather than 'CORE::foo', even in the presence of a sub foo{}.
However, these weren't:
glob
pos
prototype
scalar
study
undef
This was due to them having prototypes.
fc => 'fc',
);
+# keywords that are strong and also have a prototype
+#
+my %strong_proto_keywords = map { $_ => 1 } qw(
+ glob
+ pos
+ prototype
+ scalar
+ study
+ undef
+);
+
sub keyword {
my $self = shift;
my $name = shift;
if !$hh
|| !$hh->{"feature_$feature_keywords{$name}"}
}
- if (
- $name !~ /^(?:chom?p|do|exec|glob|s(?:elect|ystem))\z/
- && !defined eval{prototype "CORE::$name"}
+ if ($strong_proto_keywords{$name}
+ || ($name !~ /^(?:chom?p|do|exec|glob|s(?:elect|ystem))\z/
+ && !defined eval{prototype "CORE::$name"})
) { return $name }
if (
exists $self->{subs_declared}{$name}