diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 10:12:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-26 18:21:46 -0700 |
commit | 94ec06bc74ba3a61d5daddf3adeaa53459960136 (patch) | |
tree | 9e06d2a9f4684d206c3b40303e55934550c52cee /pp.c | |
parent | 3e6568b4d097eff42dadf96c5f05b8b02fd9dc29 (diff) | |
download | perl-94ec06bc74ba3a61d5daddf3adeaa53459960136.tar.gz |
&CORE::rand()
This commit allows &CORE::rand to be called through references and
via ampersand syntax. pp_rand is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell rand how many arguments it’s
actually getting. See commit 0163043a for details.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2813,6 +2813,9 @@ PP(pp_rand) NV value; if (MAXARG < 1) value = 1.0; + else if (!TOPs) { + value = 1.0; (void)POPs; + } else value = POPn; if (value == 0.0) |