This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add &CORE::scalar
authorFather Chrysostomos <sprout@cpan.org>
Sat, 12 May 2012 04:54:03 +0000 (21:54 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 29 May 2012 16:36:26 +0000 (09:36 -0700)
gv.c
t/op/coreamp.t
t/op/coresubs.t

diff --git a/gv.c b/gv.c
index c53afca..1a0351f 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -469,7 +469,7 @@ S_maybe_add_coresub(pTHX_ HV * const stash, GV *gv,
     case KEY_package: case KEY_print: case KEY_printf:
     case KEY_q    : case KEY_qq   : case KEY_qr     : case KEY_qw    :
     case KEY_qx   : case KEY_redo : case KEY_require: case KEY_return:
-    case KEY_s    : case KEY_say  : case KEY_scalar : case KEY_sort  :
+    case KEY_s    : case KEY_say  : case KEY_sort   :
     case KEY_split: case KEY_state: case KEY_study  : case KEY_sub   :
     case KEY_tr   : case KEY_undef: case KEY_UNITCHECK: case KEY_unless:
     case KEY_until: case KEY_use  : case KEY_when     : case KEY_while :
index e0b7246..173fcd5 100644 (file)
@@ -721,6 +721,11 @@ is &myrindex("foffooo","o"),6,'&rindex with 2 args';
 
 test_proto 'rmdir';
 
+test_proto 'scalar';
+$tests += 2;
+is &myscalar(3), 3, '&scalar';
+lis [&myscalar(3)], [3], '&scalar in list cx';
+
 test_proto 'seek';
 {
     last if is_miniperl;
@@ -938,7 +943,7 @@ like $@, qr'^Undefined format "STDOUT" called',
     if (m?__END__?..${\0} and /^[-+](.*)/) {
       my $word = $1;
       next if
-       $word =~ /^(?:s(?:t(?:ate|udy)|(?:pli|or)t|calar|ay|ub)?|d(?:ef
+       $word =~ /^(?:s(?:t(?:ate|udy)|(?:pli|or)t|ay|ub)?|d(?:ef
                   ault|ump|o)|p(?:rintf?|ackag
                   e)|e(?:ls(?:if|e)|val|q)|g(?:[et]|iven|oto
                   |rep)|u(?:n(?:less|def|til)|se)|l(?:(?:as)?t|ocal|e)|re
index 3c1e0f4..34dba10 100644 (file)
@@ -20,7 +20,7 @@ my %unsupported = map +($_=>1), qw (
   cmp default do dump else elsif eq eval for foreach
   format ge given goto grep gt if last le local lt m map my ne next
   no  or  our  package  print  printf  q  qq  qr  qw  qx  redo  require
-  return s say scalar sort split state study sub tr undef unless until use
+  return s say sort split state  study  sub  tr  undef  unless  until  use
   when while x xor y
 );
 my %args_for = (