From c8faf1c59adb4175d5267a1413725f46ff602d48 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 2 Jan 2000 20:17:36 +0000 Subject: fix 4-arg substr() when used as argument to subroutine p4raw-id: //depot/perl@4747 --- t/op/substr.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 't/op/substr.t') 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"; -- cgit v1.2.1