summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-21 05:58:40 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-21 22:12:59 -0700
commitb82b06b8ca329f89b70366e25afb8e2be30b446e (patch)
tree2048b9c510b101230175661356eae7ca5d1f4ba6 /mg.c
parent0be9b861b326969b378910bfcdea3f19d0d42992 (diff)
downloadperl-b82b06b8ca329f89b70366e25afb8e2be30b446e.tar.gz
Reimplement $[ as a module
This commit reimplements $[ using PL_check hooks, custom pp func- tions and ties. Outside of its compile-time use, $[ is now parsed as a simple varia- ble, so function calls like foo($[) are permitted, which was not the case with the former implementation removed by e1dccc0. I consider that a bug fix. The ‘That use of $[ is unsupported’ errors are out of necessity deferred to run-time and implemented by a tied $[. Indices between 0 and the array base are now treated consistently, as are indices between a negative array base and zero. That, too, is a bug fix.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 1b24ce85d6..8c986a5fd7 100644
--- a/mg.c
+++ b/mg.c
@@ -2723,10 +2723,6 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
PL_ors_sv = NULL;
}
break;
- case '[':
- if (SvIV(sv) != 0)
- Perl_croak(aTHX_ "Assigning non-zero to $[ is no longer possible");
- break;
case '?':
#ifdef COMPLEX_STATUS
if (PL_localizing == 2) {