This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
prototype("CORE::recv")
authorSimon Cozens <simon@netthink.co.uk>
Wed, 11 Apr 2001 13:24:35 +0000 (14:24 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 11 Apr 2001 16:53:15 +0000 (16:53 +0000)
Message-ID: <20010411132435.A26169@netthink.co.uk>

p4raw-id: //depot/perl@9685

pp.c
t/comp/proto.t

diff --git a/pp.c b/pp.c
index 9d96b94..6730f29 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -448,10 +448,12 @@ PP(pp_prototype)
                    else if (n && str[0] == ';' && seen_question)
                        goto set;       /* XXXX system, exec */
                    if ((oa & (OA_OPTIONAL - 1)) >= OA_AVREF
-                       && (oa & (OA_OPTIONAL - 1)) <= OA_HVREF) {
+                       && (oa & (OA_OPTIONAL - 1)) <= OA_SCALARREF
+                       /* But globs are already references (kinda) */
+                       && (oa & (OA_OPTIONAL - 1)) != OA_FILEREF
+                   ) {
                        str[n++] = '\\';
                    }
-                   /* What to do with R ((un)tie, tied, (sys)read, recv)? */
                    str[n++] = ("?$@@%&*$")[oa & (OA_OPTIONAL - 1)];
                    oa = oa >> 4;
                }
index 5fce526..d0e0acb 100755 (executable)
@@ -16,7 +16,7 @@ BEGIN {
 
 use strict;
 
-print "1..124\n";
+print "1..125\n";
 
 my $i = 1;
 
@@ -502,3 +502,7 @@ for my $p ( "", qw{ () ($) ($@) ($%) ($;$) (&) (&\@) (&@) (%) (\%) (\@) } ) {
 # Not $$;$;$
 print "not " unless prototype "CORE::substr" eq '$$;$$';
 print "ok ", $i++, "\n";
+
+# recv takes a scalar reference for its second argument
+print "not " unless prototype "CORE::recv" eq '*\\$$$';
+print "ok ", $i++, "\n";