diff options
-rw-r--r-- | pp.c | 6 | ||||
-rwxr-xr-x | t/comp/proto.t | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -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; } diff --git a/t/comp/proto.t b/t/comp/proto.t index 5fce52685a..d0e0acbc0b 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -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"; |