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

Accidental attributes+prototype fix

Thread Next
From:
Rafael Garcia-Suarez
Date:
October 8, 2014 06:54
Subject:
Accidental attributes+prototype fix
Message ID:
CAMoYMM-rzu7koxKyzg79nVHC=fWO3UuegVa6F-ZvA_6Q=7R5Vg@mail.gmail.com
The program below will correctly print $ with perls 5.16 and above,
but does not get the prototype on earlier perls: (the BEGIN is required)

use strict;
use warnings;
use Attribute::Handlers;
sub Foo :ATTR(BEGIN) {
    my (undef, undef, $referent) = @_;
    print prototype($referent),"\n";
}
sub bar ($) :Foo { }

This does not appear to be documented in any perldelta, so I'm
wondering if this fix is accidental, and more importantly do anyone
know if we have a regression test for it?

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