P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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]
In reply to Re^8: A short whishlist of Perl5 improvements leaping to Perl7
by choroba
|
|