defaults to $_ at compile-time, instead of run-time (like all
other primitives that default to $_).
p4raw-link: @18751 on //depot/perl:
13dcffc60adeca175c32a1ea11ec8756d4853ad2
p4raw-id: //depot/perl@22047
#define ck_substr Perl_ck_substr
#define ck_svconst Perl_ck_svconst
#define ck_trunc Perl_ck_trunc
+#define ck_unpack Perl_ck_unpack
#define pp_aassign Perl_pp_aassign
#define pp_abs Perl_pp_abs
#define pp_accept Perl_pp_accept
#define ck_substr(a) Perl_ck_substr(aTHX_ a)
#define ck_svconst(a) Perl_ck_svconst(aTHX_ a)
#define ck_trunc(a) Perl_ck_trunc(aTHX_ a)
+#define ck_unpack(a) Perl_ck_unpack(aTHX_ a)
#define pp_aassign() Perl_pp_aassign(aTHX)
#define pp_abs() Perl_pp_abs(aTHX)
#define pp_accept() Perl_pp_accept(aTHX)
}
OP *
+Perl_ck_unpack(pTHX_ OP *o)
+{
+ OP *kid = cLISTOPo->op_first;
+ if (kid->op_sibling) {
+ kid = kid->op_sibling;
+ if (!kid->op_sibling)
+ kid->op_sibling = newDEFSVOP();
+ }
+ return ck_fun(o);
+}
+
+OP *
Perl_ck_substr(pTHX_ OP *o)
{
o = ck_fun(o);
MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2hv */
MEMBER_TO_FPTR(Perl_ck_null), /* helem */
MEMBER_TO_FPTR(Perl_ck_null), /* hslice */
- MEMBER_TO_FPTR(Perl_ck_fun), /* unpack */
+ MEMBER_TO_FPTR(Perl_ck_unpack), /* unpack */
MEMBER_TO_FPTR(Perl_ck_fun), /* pack */
MEMBER_TO_FPTR(Perl_ck_split), /* split */
MEMBER_TO_FPTR(Perl_ck_join), /* join */
# Explosives and implosives.
-unpack unpack ck_fun @ S S?
+unpack unpack ck_unpack @ S S?
pack pack ck_fun mst@ S L
split split ck_split t@ S S S
join join or string ck_join mst@ S L
Perl_ck_substr
Perl_ck_svconst
Perl_ck_trunc
+Perl_ck_unpack
Perl_pp_null
Perl_pp_stub
Perl_pp_scalar
PP(pp_unpack)
{
dSP;
- SV *right = (MAXARG > 1) ? POPs : GvSV(PL_defgv);
- SV *left = POPs;
+ dPOPPOPssrl;
I32 gimme = GIMME_V;
STRLEN llen;
STRLEN rlen;
PERL_CKDEF(Perl_ck_substr)
PERL_CKDEF(Perl_ck_svconst)
PERL_CKDEF(Perl_ck_trunc)
+PERL_CKDEF(Perl_ck_unpack)
PERL_PPDEF(Perl_pp_null)