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

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

Thread Previous
From:
Rafael Garcia-Suarez
Date:
December 28, 2014 22:35
Subject:
Re: [perl #123514] prototype() with no arguments
Message ID:
CAMoYMM9HA_M2QGGqSadTYd=egpQpbk9euWuaaR5UAjtEeTNd4g@mail.gmail.com
On 28 December 2014 at 23:17, Father Chrysostomos
<perlbug-followup@perl.org> wrote:
> 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

Thread Previous


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