summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-07-08 08:39:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-07-08 09:10:46 -0700
commit7c4c6e7cb76c912fc1c4218cf14243fc37bd530a (patch)
tree58e0f3c4c5d790457c051d57bb7f8c37dffc9fb2 /pp.c
parent1fb5e7d7953f8a63127afab98dc2efd59a1a472f (diff)
downloadperl-7c4c6e7cb76c912fc1c4218cf14243fc37bd530a.tar.gz
Add prototypes for __FILE__ &c.
Before this commit, prototype("CORE::__FILE__") would die with ‘Can’t find an op number...’. That __FILE__ does not have an op number whereas time() does is an implementation detail that should not be exposed to the user. So this commit adds prototypes for __FILE__, __LINE__ and __PACKAGE__.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 98d64827e0..3c46fc3f31 100644
--- a/pp.c
+++ b/pp.c
@@ -466,6 +466,11 @@ PP(pp_prototype)
ret = newSVpvs_flags("\\[$@%*]$@", SVs_TEMP);
goto set;
}
+ if (code == -KEY___FILE__ || code == -KEY___LINE__
+ || code == -KEY___PACKAGE__) {
+ ret = newSVpvs_flags("", SVs_TEMP);
+ goto set;
+ }
if (code == -KEY_readpipe) {
s = "CORE::backtick";
}