Joel Maslak
- Website: digitalbarbedwire.com
Recent Actions
-
Commented on Current subroutine signatures implementation contains two features which purposes are different
I wanted to see how big of a deal this is - I compared 4 different methods with around 10,000,000 sub calls. The subs did almost nothing (added the two args to a state variable and returned the state variable)....
-
Commented on Upping minimum version for Devel::Cover
If you can't support the 5.6, I'd up the version number, so some poor sod doesn't try installing non-working code on 5.6. If someone wants to fix it, let them, but I wouldn't advertise it as supporting something it doesn't...
-
Commented on Regex /m modifier bug in Perl 5.8.8 and older
One tip for building perl with modern hardware: pass it a parallel make command (use those cores!). Example: perlbrew install perl-5.23.8 -j8 That passes the -j8 to make when building perl, resulting in a much faster build and less watching...
Comment Threads
-
Slobo commented on
Current subroutine signatures implementation contains two features which purposes are different
I'm also genuinely interested in your argument that dynamic language implies no argument checking, do you mind elaborating a bit more on it?
-
Yuki Kimoto commented on
Current subroutine signatures implementation contains two features which purposes are different
Slobo
I don't believe correctness by argument count checking. I don't need this feature.
There are two type people.
Why subroutine signature forces argument count checking by default syntax?
sub ($foo, $bar, @) is not good syntax, I don't want to use this syntax for only avoid argument count checking.
"sub foo($x, $y)" meaning "sub foo { my ($x, $y) = @_ }" is natural expansion most people want.
Argument count checking is next step.
-
Slobo commented on
Current subroutine signatures implementation contains two features which purposes are different
Hi Yuki, thanks for your response.
I am always looking to learn better software engineering techniques. I hope you don't mind me pressing for more details from you. Is it only the performance impact of arg count check that bothers you? Or do you find yourself often wanting to define
sub foo($bar) { ... }
and then use it as
foo( $bar, $baz );
# or maybe
foo( @only_first_matters )I am curious to discover any techniques that revolve around these patterns?
Re: correctness, I can only offer my own experience with a legacy code … -
Yuki Kimoto commented on
Current subroutine signatures implementation contains two features which purposes are different
Slobo
Thanks for your comment.
-
Flavio Poletti commented on
Regex /m modifier bug in Perl 5.8.8 and older
The problem is that
qr{}
has a bug in older perls in that it does not propagate the modifiers when they are set outside (e.g.mxs
inqr{/whatever}mxs
). See here about this.My personal "mental discipline" is to never use regexp modifiers outside, but always set them inside through a non-capturing group, e.g.
qr{(?mxs:/whatever)}
. In this way I don't have to worry about special tricks in 5.8.x.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.