user-pic

Brad Gilbert

  • About: I blog about Perl.
  • Commented on Perl Weekly Challenge #014
    $solution ~~ m:g/../ $solution.comb(2) # much faster $a % 2 == 0 $a %% 2 # clearer...
  • Commented on StackOverflow that!
    Stack Overflow publishes stats on what questions get asked....
  • Commented on Backticks and tests in Perl 6
    You can (and should) remove .slurp and .slurp-rest The IO object has a .split method that doesn't have to read the entire contents of the file before splitting the file up....
  • Commented on Starting to Learn Regexes in Perl 6
    Actually the second for loop has 3 levels of signature unpacking. You don't see the first one which is implicit....
  • Commented on Starting to Learn Regexes in Perl 6
    #! /usr/bin/env perl6 use v6; my @mixer = 'mixer'; my @player = < m6player -vf dsize=600:-2 -geometry +200-10 >; my $lockfile = '/tmp/myplayer'; $lockfile.IO.spurt( $*PID ); END { $lockfile.IO.unlink; } my token filename { .+? \.\S\S\S }; my token volume...
  • Commented on Simple Game in Perl 6
    It wouldn't be more efficient, it would actually be correct. $new would effentially be the same as your card. use v6; my @deck = True, False; my $card = @deck.pick; say "your card is $card"; for ^5 { say @deck.pick...
  • Commented on Minor Issue with Perl 6 Install on CentOS 6
    https://github.com/rakudo/rakudo/search?q=lsb_release...
  • Commented on Simple Game in Perl 6
    Array.pick() doesn't do what you think it does, it never modifies the array you call it on. With no arguments it returns one item, with a positive number it returns a list of that many elements with no repeats, with...
  • Posted Perl6 Pi and continued fractions to Brad Gilbert

    I was looking through the code of the Rakudo implementation of Perl6 where I noticed that it defines pi as my constant pi = 3.14159_26535_89793_238e0; ( with an alias my constant π := pi; )

  • Commented on (?P&lt;NAME&gt;...) vs (?&lt;NAME&gt;...)
    I believe the reason we support the Python variant is that we stole the idea from them. I think the other libraries/languages stole it from Perl....
  • Commented on Perl and Windows UAC
    Shell.Application was added for WScript and CScript scripts, so the actual functionality should be accessible directly with Win32::API. I'm not sure at the moment what it is calling under the hood....
  • Commented on Where to find the good stuff
    Actually I have been in contact with someone responsible for tutorialspoint.com ( on the reject list ) and have gotten him to change the Perl subroutines page. It took a bit of convincing on my part that I indeed knew...
  • Commented on lex parsimoniae
    It is generally a bug if a OO module has a blessed method. As it usually means they imported blessed from Scalar::Util. ( which Moose does on your behalf ) without removing it from the namespace after it is no...
  • Commented on A smaller, faster, more agile Perl
    I was going through my RSS backlog when I read this. I'm not proud to say that I didn't realize it was posted on April 1st until the PL/1 paragraph....
  • Commented on The Road to Hell is Paved With Good Intentions
    Well = isn't a valid comparison operator, perhaps you meant ==....
  • Commented on Why code style is important
    I believe this is part of the reason C/C++ programmers put the braces on a new line, to make them stand out. Whereas when you program in Perl, you know the brace is there otherwise it wouldn't compile....
  • Commented on Perl and Me, Part 11: Please Mr. Perl, Will You DWIM?
    I think that the reason C/C++ programmers put the braces on a new line is that you can omit them in some circumstances. You can't omit them in Perl the same way, so there is no need to make them...
  • Commented on Perl and Me, Part 7: The Most Powerful Weapon Which You Can Use to Change the World
    That still isn't a reason to not work on the Perl core. My first patch was to convert while( readdir($dh) ){...} into while( defined( $_ = readdir($dh) ) ){...} I don't even (really) know how to program in C. I...
  • Commented on Lexical closures with END blocks warn, but Just Work
    You could add the values to a state variable. sub print_it { my $value = shift; print "During execution, got [$value]\n"; state $old = []; # Uses push instead of unshift # because push is probably faster on long arrays....
  • Commented on Tool tip: looking at a module's source
    I usually type out komodo $(pm_which -q Some::Module) ( The -q is in case I mistyped the module. ) I have thought about writing a script that opens the file in komodo if it is running, and otherwise open it...
  • Commented on List Assignment in Scalar Context
    There is a way to get what you were looking for in your last few paragraphs. (my($input, $output) = @ARGV) == 2 or die "Usage: $0 "; Although I would generally separate out the argument count checking from the assignment....
  • Commented on Great Mystic Mystery Revealed
    As Paul "LeoNerd" Evens stated: It was originally a quick (hack), a limit of the parser used to pull out the package names. But so many people have now relied on it, that it's become a feature that won't be...
  • Commented on Great Mystic Mystery Revealed
    Actually I think that PAUSE only parses the modules if it can't find META.json or META.yml Since the DBD-Oracle distribution uses Dist::Zilla, it was actually Dist::Zilla which added it. You could have also added some lines to the dist.ini file...
  • Commented on Keeping up to date.
    cpanp 'o;i *'...
  • Commented on Perl and Me, Part 1: The Road So Far
    There are a couple of reasons I haven't ever pursued working on the Perl internals despite my C background, and time is certainly a big one. I've picked up a enough perlguts to know that learning how the interpreter works...
  • Commented on Perl and Me, Part 1: The Road So Far
    You might like D. It's basically a re-write of C++, in a similar way to how Perl6 is a re-write of Perl5. Also since you know C you could help improve the Perl internals, if your not too busy....
  • Commented on Comparing Apples and Oranges - rubygems vs cpan part 2
    I agree that it could be made easier to upload modules. I think we should strive for higher quality of code on CPAN; rather than on sheer quantity. So I think we should have a few minor hurdles to jump...
  • Commented on How do we know when a CORE module is deprecated?
    It is not deprecated. I think mst misread an email from Ricardo Signes to the P5P list....
  • Commented on Holy bloat, Batman!
    I have sent a patch to Perl5 Porters to remedy this situation. Based on the comment just before "*{chr 256} = \3;" this should have been reworked after the next dev release (5.15.4). - # Before this makes its way...
  • Commented on Holy bloat, Batman!
    The offending line: *{chr 256} = \3; which is only used for: if (exists ${__PACKAGE__."::"}{"\xc4\x80"}) { delete ${__PACKAGE__."::"}{"\xc4\x80"}; *_DOWNGRADE = sub () {1}; } else { delete ${__PACKAGE__."::"}{chr 256}; *_DOWNGRADE = sub () {0}; } Thank you for bringing this...
Subscribe to feed Recent Actions from Brad Gilbert

Subscribe to feed Responses to Comments from Brad Gilbert

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a design donated by Six Apart, Ltd.