Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^8: A short whishlist of Perl5 improvements leaping to Perl7

by choroba (Cardinal)
on Nov 30, 2020 at 16:54 UTC ( [id://11124405]=note: print w/replies, xml ) Need Help??


in reply to Re^7: A short whishlist of Perl5 improvements leaping to Perl7
in thread A short whishlist of Perl5 improvements leaping to Perl7

I don't like state in named subroutines. It makes it hard to reïnitialise the variable and causes hard to debug problems. An anonymous sub is OK, because the state variable is reïnitialised every time the sub is created.

But in this particular case, it's not highly probable you'd ever need to reïnitialise the variable. But, if you plan to convert from different digit systems, you'll quickly see why state is not the solution.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124405]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found