tot = sp - mark;
while (++mark <= sp) {
GV* gv;
+ SvGETMAGIC(*mark);
if (isGV_with_GP(*mark)) {
gv = MUTABLE_GV(*mark);
do_fchmod:
goto do_fchmod;
}
else {
- const char *name = SvPV_nolen_const(*mark);
+ const char *name = SvPV_nomg_const_nolen(*mark);
APPLY_TAINT_PROPER();
if (PerlLIO_chmod(name, val))
tot--;
tot = sp - mark;
while (++mark <= sp) {
GV* gv;
+ SvGETMAGIC(*mark);
if (isGV_with_GP(*mark)) {
gv = MUTABLE_GV(*mark);
do_fchown:
goto do_fchown;
}
else {
- const char *name = SvPV_nolen_const(*mark);
+ const char *name = SvPV_nomg_const_nolen(*mark);
APPLY_TAINT_PROPER();
if (PerlLIO_chown(name, val, val2))
tot--;
Assignments like C<*$tied = \&{"..."}> and C<*glob = $tied> now call FETCH
only once.
+=item *
+
+C<chdir>, C<chmod> and C<chown> now always call FETCH if passed a tied
+variable as the last argument. They used to ignore tiedness if the last
+thing return from or assigned to the variable was a typeglob or reference
+to a typeglob.
+
=back
=head1 Known Problems
if (PL_op->op_flags & OPf_SPECIAL) {
gv = gv_fetchsv(sv, 0, SVt_PVIO);
}
- else if (isGV_with_GP(sv)) {
+ else if (SvGETMAGIC(sv), isGV_with_GP(sv)) {
gv = MUTABLE_GV(sv);
}
else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
gv = MUTABLE_GV(SvRV(sv));
}
else {
- tmps = SvPV_nolen_const(sv);
+ tmps = SvPV_nomg_const_nolen(sv);
}
}
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 220);
+ plan (tests => 223);
}
use strict;
# Assignment.
$dummy = $var ; check_count "=";
-{
- no warnings 'once';
- *dummy = $var ; check_count '*glob = $tied';
-}
+*dummy = $var ; check_count '*glob = $tied';
# Unary +/-
$dummy = +$var ; check_count "unary +";
*$var9 = \&{"glumscrin"}; check_count '*$tied = \&{"name of const"}';
}
+# This line makes $var8 hold a glob:
+$var8 = *dummy; $dummy = $var8; $count = 0;
+eval { chdir $var8 } ; check_count 'chdir $tied_glob';
+$var8 = *dummy; $dummy = $var8; $count = 0;
+eval { chmod 0, $var8 } ; check_count 'chmod 0,$tied_glob';
+$var8 = *dummy; $dummy = $var8; $count = 0;
+eval { chown 0,0,$var8 }; check_count 'chmod 0,$tied_glob';
+
+
###############################################
# Tests for $foo binop $foo #
###############################################