develooper Front page | perl.perl5.porters | Postings from December 2014

Re: [perl #123514] prototype() with no arguments

Thread Previous | Thread Next
From:
John Imrie
Date:
December 28, 2014 22:42
Subject:
Re: [perl #123514] prototype() with no arguments
Message ID:
54A0874B.1060009@virginmedia.com
On 28/12/2014 22:17, Father Chrysostomos (via RT) wrote:
> # 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About