Skip Menu |
Report information
Id: 123514
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors:
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



Subject: prototype() with no arguments
Download (untitled) / with headers
text/plain 456b
prototype() is not documented as accepting no arguments. But it does accept no arguments, and corrupts the stack in the process: $ ./perl -Ilib -le '$,=" "; print 1,2,3,prototype(),4,5,6' 1 2 4 5 6 Here, it steals 3 from the stack and replaces it with undef. Here is a more intriguing example: $ ./perl -Ilib -le 'print "CORE::undef", prototype()' ;\[$@%&*] Should prototype() be illegal? Or should it mean prototype($_)? -- Father Chrysostomos
From: Rafael Garcia-Suarez <rgarciasuarez [...] gmail.com>
To: "perl5-porters [...] perl.org" <perl5-porters [...] perl.org>
Subject: Re: [perl #123514] prototype() with no arguments
Date: Sun, 28 Dec 2014 23:35:16 +0100
Download (untitled) / with headers
text/plain 743b
On 28 December 2014 at 23:17, Father Chrysostomos <perlbug-followup@perl.org> wrote: Show quoted text
> prototype() is not documented as accepting no arguments. But it does accept no arguments, and corrupts the stack in the process: > > $ ./perl -Ilib -le '$,=" "; print 1,2,3,prototype(),4,5,6' > 1 2 4 5 6 > > Here, it steals 3 from the stack and replaces it with undef. Here is a more intriguing example: > > $ ./perl -Ilib -le 'print "CORE::undef", prototype()' > ;\[$@%&*] > > Should prototype() be illegal? Or should it mean prototype($_)?
Well, according to itself, it requires one argument: perl -E 'say prototype"CORE::prototype"' $ which is probably an implementation detail. I see no strong objection against allowing a default topic for it
From: John Imrie <j.imrie1 [...] virginmedia.com>
To: perl5-porters [...] perl.org
Subject: Re: [perl #123514] prototype() with no arguments
Date: Sun, 28 Dec 2014 22:42:19 +0000
Download (untitled) / with headers
text/plain 817b
On 28/12/2014 22:17, Father Chrysostomos (via RT) wrote: Show quoted text
> # New Ticket Created by Father Chrysostomos > # Please include the string: [perl #123514] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=123514 > > > > prototype() is not documented as accepting no arguments. But it does accept no arguments, and corrupts the stack in the process: > > $ ./perl -Ilib -le '$,=" "; print 1,2,3,prototype(),4,5,6' > 1 2 4 5 6 > > Here, it steals 3 from the stack and replaces it with undef. Here is a more intriguing example: > > $ ./perl -Ilib -le 'print "CORE::undef", prototype()' > ;\[$@%&*] > > Should prototype() be illegal? Or should it mean prototype($_)? >
I'd go for the latter, prototype($_), in line with oct(), say(), print() etc
RT-Send-CC: perl5-porters [...] perl.org
Fixed in eb4ec35b to infer $_. -- Father Chrysostomos
CC: ;, perl5-porters [...] perl.org
Subject: Re: [perl #123514] prototype() with no arguments
Date: Sun, 28 Dec 2014 19:51:01 -0500
From: Ricardo Signes <perl.p5p [...] rjbs.manxome.org>
To: Father Chrysostomos via RT <perlbug-followup [...] perl.org>
Download (untitled) / with headers
text/plain 126b
* Father Chrysostomos via RT <perlbug-followup@perl.org> [2014-12-28T19:46:19] Show quoted text
> Fixed in eb4ec35b to infer $_.
+1 -- rjbs
Download signature.asc
application/pgp-signature 473b

Message body not shown because it is not plain text.



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org