@@ -528,7 +528,7 @@ PP(pp_die)
528528/* I/O. */
529529
530530OP *
531- Perl_tied_method (pTHX_ const char * const methname , SV * * sp , SV * const sv ,
531+ Perl_tied_method (pTHX_ SV * methname , SV * * sp , SV * const sv ,
532532 const MAGIC * const mg , const U32 flags , U32 argc , ...)
533533{
534534 SV * * orig_sp = sp ;
@@ -572,7 +572,7 @@ Perl_tied_method(pTHX_ const char *const methname, SV **sp, SV *const sv,
572572 SAVEGENERICSV (PL_ors_sv );
573573 PL_ors_sv = newSVpvs ("\n" );
574574 }
575- ret_args = call_method (methname , flags & G_WANT );
575+ ret_args = call_sv (methname , ( flags & G_WANT )| G_METHOD_NAMED );
576576 SPAGAIN ;
577577 orig_sp = sp ;
578578 POPSTACK ;
@@ -623,7 +623,7 @@ PP(pp_open)
623623 if (mg ) {
624624 /* Method's args are same as ours ... */
625625 /* ... except handle is replaced by the object */
626- return Perl_tied_method (aTHX_ " OPEN" , mark - 1 , MUTABLE_SV (io ), mg ,
626+ return Perl_tied_method (aTHX_ SV_CONST ( OPEN ) , mark - 1 , MUTABLE_SV (io ), mg ,
627627 G_SCALAR | TIED_METHOD_ARGUMENTS_ON_STACK ,
628628 sp - mark );
629629 }
@@ -662,7 +662,7 @@ PP(pp_close)
662662 if (io ) {
663663 const MAGIC * const mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar );
664664 if (mg ) {
665- return tied_method0 (" CLOSE" , SP , MUTABLE_SV (io ), mg );
665+ return tied_method0 (SV_CONST ( CLOSE ) , SP , MUTABLE_SV (io ), mg );
666666 }
667667 }
668668 }
@@ -745,7 +745,7 @@ PP(pp_fileno)
745745 if (io
746746 && (mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar )))
747747 {
748- return tied_method0 (" FILENO" , SP , MUTABLE_SV (io ), mg );
748+ return tied_method0 (SV_CONST ( FILENO ) , SP , MUTABLE_SV (io ), mg );
749749 }
750750
751751 if (!io || !(fp = IoIFP (io ))) {
@@ -816,7 +816,7 @@ PP(pp_binmode)
816816 function, which I don't think that the optimiser will be able to
817817 figure out. Although, as it's a static function, in theory it
818818 could. */
819- return Perl_tied_method (aTHX_ " BINMODE" , SP , MUTABLE_SV (io ), mg ,
819+ return Perl_tied_method (aTHX_ SV_CONST ( BINMODE ) , SP , MUTABLE_SV (io ), mg ,
820820 G_SCALAR |TIED_METHOD_MORTALIZE_NOT_NEEDED ,
821821 discp ? 1 : 0 , discp );
822822 }
@@ -1298,7 +1298,7 @@ PP(pp_getc)
12981298 const MAGIC * const mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar );
12991299 if (mg ) {
13001300 const U32 gimme = GIMME_V ;
1301- Perl_tied_method (aTHX_ " GETC" , SP , MUTABLE_SV (io ), mg , gimme , 0 );
1301+ Perl_tied_method (aTHX_ SV_CONST ( GETC ) , SP , MUTABLE_SV (io ), mg , gimme , 0 );
13021302 if (gimme == G_SCALAR ) {
13031303 SPAGAIN ;
13041304 SvSetMagicSV_nosteal (TARG , TOPs );
@@ -1535,7 +1535,7 @@ PP(pp_prtf)
15351535 Move (MARK , MARK + 1 , (SP - MARK ) + 1 , SV * );
15361536 ++ SP ;
15371537 }
1538- return Perl_tied_method (aTHX_ " PRINTF" , mark - 1 , MUTABLE_SV (io ),
1538+ return Perl_tied_method (aTHX_ SV_CONST ( PRINTF ) , mark - 1 , MUTABLE_SV (io ),
15391539 mg ,
15401540 G_SCALAR | TIED_METHOD_ARGUMENTS_ON_STACK ,
15411541 sp - mark );
@@ -1624,7 +1624,7 @@ PP(pp_sysread)
16241624 {
16251625 const MAGIC * const mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar );
16261626 if (mg ) {
1627- return Perl_tied_method (aTHX_ " READ" , mark - 1 , MUTABLE_SV (io ), mg ,
1627+ return Perl_tied_method (aTHX_ SV_CONST ( READ ) , mark - 1 , MUTABLE_SV (io ), mg ,
16281628 G_SCALAR | TIED_METHOD_ARGUMENTS_ON_STACK ,
16291629 sp - mark );
16301630 }
@@ -1862,7 +1862,7 @@ PP(pp_syswrite)
18621862 PUTBACK ;
18631863 }
18641864
1865- return Perl_tied_method (aTHX_ " WRITE" , mark - 1 , MUTABLE_SV (io ), mg ,
1865+ return Perl_tied_method (aTHX_ SV_CONST ( WRITE ) , mark - 1 , MUTABLE_SV (io ), mg ,
18661866 G_SCALAR | TIED_METHOD_ARGUMENTS_ON_STACK ,
18671867 sp - mark );
18681868 }
@@ -2075,7 +2075,7 @@ PP(pp_eof)
20752075 RETPUSHNO ;
20762076
20772077 if ((io = GvIO (gv )) && (mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar ))) {
2078- return tied_method1 (" EOF" , SP , MUTABLE_SV (io ), mg , newSVuv (which ));
2078+ return tied_method1 (SV_CONST ( EOF ) , SP , MUTABLE_SV (io ), mg , newSVuv (which ));
20792079 }
20802080
20812081 if (!MAXARG && (PL_op -> op_flags & OPf_SPECIAL )) { /* eof() */
@@ -2115,7 +2115,7 @@ PP(pp_tell)
21152115 if (io ) {
21162116 const MAGIC * const mg = SvTIED_mg ((const SV * )io , PERL_MAGIC_tiedscalar );
21172117 if (mg ) {
2118- return tied_method0 (" TELL" , SP , MUTABLE_SV (io ), mg );
2118+ return tied_method0 (SV_CONST ( TELL ) , SP , MUTABLE_SV (io ), mg );
21192119 }
21202120 }
21212121 else if (!gv ) {
@@ -2155,7 +2155,7 @@ PP(pp_sysseek)
21552155 SV * const offset_sv = newSViv (offset );
21562156#endif
21572157
2158- return tied_method2 (" SEEK" , SP , MUTABLE_SV (io ), mg , offset_sv ,
2158+ return tied_method2 (SV_CONST ( SEEK ) , SP , MUTABLE_SV (io ), mg , offset_sv ,
21592159 newSViv (whence ));
21602160 }
21612161 }
0 commit comments