diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-02 20:17:36 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-02 20:17:36 +0000 |
commit | c8faf1c59adb4175d5267a1413725f46ff602d48 (patch) | |
tree | 261390130f8f907e5fc0605684d080430baefc70 /t/op/substr.t | |
parent | 7a3f225871b642595bb66695465453bbff5332c7 (diff) | |
download | perl-c8faf1c59adb4175d5267a1413725f46ff602d48.tar.gz |
fix 4-arg substr() when used as argument to subroutine
p4raw-id: //depot/perl@4747
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-x | t/op/substr.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t index 87efcb4512..8d31a9ae61 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..106\n"; +print "1..108\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -209,3 +209,9 @@ print "ok 105\n"; eval 'substr($a,0,0,"") = "abc"'; print "not " unless $@ && $@ =~ /Can't modify substr/ && $a eq "foo"; print "ok 106\n"; + +$a = "abcdefgh"; +print "not " unless sub { shift }->(substr($a, 0, 4, "xxxx")) eq 'abcd'; +print "ok 107\n"; +print "not " unless $a eq 'xxxxefgh'; +print "ok 108\n"; |