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

[perl #123514] prototype() with no arguments

Thread Previous | Thread Next
Father Chrysostomos
December 28, 2014 22:18
[perl #123514] prototype() with no arguments
Message ID:
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #123514]
# in the subject line of all future correspondence about this issue. 
# <URL: >

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About