diff options
author | Zefram <zefram@fysh.org> | 2011-09-09 23:27:16 +0100 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2011-09-09 23:30:02 +0100 |
commit | e1dccc0d34a90e3511bfed596be9d78128ca7ee7 (patch) | |
tree | 1e72ad2098f66ac1c59debfc46c00d1013fc0a9f /t/re/substr.t | |
parent | 0b31f5359876e6c0b203006714db218d7b441cd1 (diff) | |
download | perl-e1dccc0d34a90e3511bfed596be9d78128ca7ee7.tar.gz |
remove index offsetting ($[)
$[ remains as a variable. It no longer has compile-time magic.
At runtime, it always reads as zero, accepts a write of zero, but dies
on writing any other value.
Diffstat (limited to 't/re/substr.t')
-rw-r--r-- | t/re/substr.t | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/t/re/substr.t b/t/re/substr.t index 341625619a..b48cb8f00c 100644 --- a/t/re/substr.t +++ b/t/re/substr.t @@ -24,7 +24,7 @@ $SIG{__WARN__} = sub { BEGIN { require './test.pl'; } -plan(363); +plan(356); run_tests() unless caller; @@ -44,20 +44,6 @@ like ($@, $FATAL_MSG); is(substr($a,0,-6), 'abc'); # P=Q R S is(substr($a,-3,1), 'x'); # P Q R S -$[ = 1; - -is(substr($a,1,3), 'abc' ); # P=Q R S -is(substr($a,4,3), 'def' ); # P Q R S -is(substr($a,7,999), 'xyz');# P Q S R -$b = substr($a,999,999) ; # warn # P R Q S -is($w--, 1); -eval{substr($a,999,999) = "" ; } ; # P R Q S -like ($@, $FATAL_MSG); -is(substr($a,1,-6), 'abc' );# P=Q R S -is(substr($a,-3,1), 'x' ); # P Q R S - -$[ = 0; - substr($a,3,3) = 'XYZ'; is($a, 'abcXYZxyz' ); substr($a,0,2) = ''; |