user-pic

Brad Gilbert

  • About: I blog about Perl.
  • 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<NAME>...) vs (?<NAME>...)
    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...
  • Commented on pathed - munge the Bash PATH
    Marcel, Env is actually a really small module. Especially since it works on many different systems....
  • Commented on Swampy.pm6
    Why would you do all kinds of difficult work, when you can easily cheat? ( Like using the elevator instead of the stairs ) Perl has stolen many ideas from other languages. Why not cheat when you are writing answers...
  • Commented on Think Python, But Perl 6 - Chapter 3: Functions
    Exercise 3 is slightly wrong. It doesn't take into account that Unicode characters have different widths. This is of-course a problem with the question, not with your answer....
  • Commented on PAUSE permissions should be case-insensitive
    This is (of-course) also a problem on Windows....
  • Commented on Bringing Perl5 to GitHub
    I know there was a project that imported their entire bug-report database into GitHub. ( may have actually been Rakudo )...
  • Commented on A very small script to check the masking information for each of the cloned devices.
    Instead of copying the commands into batch file, why don't you just execute them? (using one of the following) system "symmask -sid $symmid list assign -devs $+{source}"; `symmask -sid $symmid list assign -devs $+{source}`; system 'symmask', '-sid', $symmid, qw'list assign...
  • Commented on My Prediction
    Changing the version to 7 will probably cause more problems than it solves. I also doubt that just changing the version number will (by itself) really change things enough for it to be worth it....
  • Commented on Q: When not to use Regexp? A: HTML parsing
    http://stackoverflow.com/a/1732454/1337...
Subscribe to feed Recent Actions from Brad Gilbert

  • Ether commented on Why code style is important

    This looks like something that could have happened from a git merge, without someone manually reviewing the result of the merge.

    The same thing would have happened if braces were used like this:

    if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
    { goto fail; }
    { goto fail; }

    Only if the braces were on a different line would we either have gotten a
    detectable merge conflict, or a second goto operation that did no harm:

    if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
    goto fail;

  • byterock commented on The Road to Hell is Paved With Good Intentions

    yes '=' is not valid but it worked oddly enough with some versions of 'Test::More'

  • Alex commented on Perl and Windows UAC

    Hi! What about Win32::IsAdminUser() to check for elevated privileges? The docs say:

    Returns non zero if the account in whose security context the current process/thread is running belongs to the local group of Administrators in the built-in system domain; returns 0 if not. On Windows Vista it will only return non-zero if the process is actually running with elevated privileges. Returns undef and prints a warning if an error occurred. This function always returns 1 on Win9X.

    Source: http://search.cpan.org/…

  • Michael Roberts commented on Perl and Windows UAC

    Hey, Alex - great find! I swear I looked for that kind of stuff for like a week and finally just gave up. I'll put this into the next version for sure.

    Thanks!

  • fibo commented on How do we know when a CORE module is deprecated?

    Come on, it's not that tragedy. On RedHat perl-CGI is already packaged.

    It is not that difficut to include instructions for those who want to port their CGI scripts.

    Something like


    sudo cpan CGI

    will do the trick ;)

    I think Perl can move on and remove CGI.pm from core modules.

    What it is really missing in the core, in my opinion, are IO::Socket::SSL and Plack.

    Look at Node.js core, for example http://nodejs.org/api/tls.html

    We need https!

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 and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.