t/op/sprintf2.t See if sprintf works
t/op/sprintf.t See if sprintf works
t/op/srand.t See if srand works
+t/op/sselect.t See if 4 argument select works
t/op/stash.t See if %:: stashes work
t/op/stat.t See if stat works
t/op/study.t See if study works
SP -= 4;
for (i = 1; i <= 3; i++) {
- if (!SvPOK(SP[i]))
+ SV *sv = SP[i];
+ if (SvOK(sv) && SvREADONLY(sv)) {
+ if (SvIsCOW(sv))
+ sv_force_normal_flags(sv, 0);
+ if (SvREADONLY(sv))
+ DIE(aTHX_ PL_no_modify);
+ }
+ if (!SvPOK(sv))
continue;
- j = SvCUR(SP[i]);
+ j = SvCUR(sv);
if (maxlen < j)
maxlen = j;
}
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = ('.', '../lib');
+}
+
+require 'test.pl';
+
+plan (6);
+
+my $blank = "";
+eval {select undef, $blank, $blank, 0};
+is ($@, "");
+eval {select $blank, undef, $blank, 0};
+is ($@, "");
+eval {select $blank, $blank, undef, 0};
+is ($@, "");
+
+eval {select "", $blank, $blank, 0};
+like ($@, qr/^Modification of a read-only value attempted/);
+eval {select $blank, "", $blank, 0};
+like ($@, qr/^Modification of a read-only value attempted/);
+eval {select $blank, $blank, "", 0};
+like ($@, qr/^Modification of a read-only value attempted/);