On Mon, 29 Jun 2020 18:40:18 +0200 Salvador Fandiño <sfandino@gmail.com> wrote: > Aren't you too focused in supporting the new subroutine attribute in > older perls instead of just providing its functionality in some way? > > For instance, it shouldn't be to difficult to write a package, say > for instance, "sub::prototype", that sets the function prototype and > works both under p5 and p7. > > sub foo { > ... > } > use sub::prototype foo => "$"; > > sub bar { > ... > } > use sub::prototype bar => "\@" Ohsure, that could work. But for that matter the following already works right now on all versions of perl sub foo { ... } BEGIN { Sub::Util::set_prototype( "$", \&foo ); } But is that really what we want to encourage new authors of perl code to be writing? If we preferred that form, why would we have designed the `:prototype` attribute in the first place? My aim was to allow people to continue writing what is valid and encouraged in both *current* perl 5.32 and proposed perl 7. -- Paul "LeoNerd" Evans leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/Thread Previous | Thread Next