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

[perl #123514] prototype() with no arguments

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
December 28, 2014 22:18
Subject:
[perl #123514] prototype() with no arguments
Message ID:
rt-4.0.18-31660-1419805073-101.123514-75-0@perl.org
# 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($_)?

-- 

Father Chrysostomos


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