diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-25 12:43:54 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-25 12:43:54 -0700 |
commit | f6a1686942506c3f2a041ff124bdc34d22ed5f26 (patch) | |
tree | 6bf0544f289bd3fe06bce6f8eb4d5e76ff56617f /op.c | |
parent | e1a80902e5e9ce316c7cc56f6c15b52b0c0a9144 (diff) | |
download | perl-f6a1686942506c3f2a041ff124bdc34d22ed5f26.tar.gz |
&CORE::binmode()
This commit allows &CORE::binmode to be called through references and
via ampersand syntax.
Usually, an op that has optional arguments has the number of arguments
indicated with flags on the op itself:
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -7685,7 +7685,16 @@ Perl_ck_fun(pTHX_ OP *o) tokid = &kid->op_sibling; kid = kid->op_sibling; } - if (kid && kid->op_type == OP_COREARGS) return o; + if (kid && kid->op_type == OP_COREARGS) { + bool optional = FALSE; + while (oa) { + numargs++; + if (oa & OA_OPTIONAL) optional = TRUE; + oa = oa >> 4; + } + if (optional) o->op_private |= numargs; + return o; + } while (oa) { if (oa & OA_OPTIONAL || (oa & 7) == OA_LIST) { |