Josh ben Jore

  • Commented on Major DB::Color update (Perl QA Hackathon)
    The dualvar isn't merely numeric or "truthy", it is the address of a COP opcode. At the numeric address is turned into a pointer and dereferenced to toggle a flag on a COP* dbstate opcode....
  • Posted Optimizing my freenode IRC to Josh ben Jore

    I wrote this obtuse little function to display six different IRC channels on freenode at once.

    (defun irc-java ()
        (switch-to-buffer (get-buffer "#perl"))
        (let* (
                  (p      (frame-parameters))
  • Posted Littlest uuencode to Josh ben Jore

    Hi, For your amusement, here's a very small uuencode program.

    perl -0777 -e '$uue = pack u, <>; print "begin 0644 $ARGV\n${uue}end\n"' your-file.bin
  • Posted Avoid my keys() accident to Josh ben Jore

    I broke $work yesterday when a change I'd made that I thought was mundane was not in fact. I'd changed some code from: if ( keys %$hash_ref ) { to if ( %$hash_ref ) { under the theory that we weren't supporting any perl less than…

  • Posted Ponies are the truth to Josh ben Jore

    Did you know you can modify perl's readonly constants for undef, true and false? Yep.

    &Internals::SvREADONLY( \ !!1, 0 );
    ${ \ !!1 } = 'ponies!';
    &Internals::SvREADONLY( \ !!1, 1 );
    print !!1; # ponies!

    Same thing for \ undef and \ !!0…

  • Commented on Benchmarking string trimming
    the point is, the ways to get optimal performance is to know what sorts of optimizations and work-avoidances your regexp engine provides and in extremis, to look at the compiled form of your regexp....
  • Posted Benchmarking string trimming to Josh ben Jore

    Clever Regexps vs Multiple Simple Regexps:

    In reading some code I ran across the expression s/^\s*|\s*$//g which is a trim function. It is not the optimal way to write this. The optimal way is two simpler expressions: s/^\s+//; s…

  • Posted My gladiators are getting entangled to Josh ben Jore


  • Posted The mod_perl debugger you've always wanted to Josh ben Jore

    To use the nice mod_perl debugger you've always wanted:

  • Commented on Unicode in Perl, FTW (Я очень рад, ведь я, наконец, возвращаюсь домой)
    It might not work for your environment if your terminal isn't properly set up for being UTF-8....
  • Commented on Design implications of MI strategies
    I'm not sure if it's entirely relevant but I noticed while reading the MRI Ruby VMs (1.8 and 1.9) that possibly Ruby's OO implementation might be completely replaceable. It's somewhat plausible that for various optimization (whether premature or not) C...
  • Posted Unicode in Perl, FTW (Я очень рад, ведь я, наконец, возвращаюсь домой) to Josh ben Jore

    Found on my hard drive. I love that it's source code that's literally in UTF-8 and it all just looks "right" or whatever that Russian says.

    use utf8;
    use Encode 'encode';
    print encode("ascii", 'Я очень рад, ведь я, наконец, возвращаюсь домой', sub{ s…
  • Posted Under the covers of perldoc to Josh ben Jore

    Sometime last year I had to go find out what happens under the covers when a user types a command like "perldoc strict." Here's the trace of which commands call which other commands. It's all in good fun.

    I'd used strace to get a process-by-process trace of…

  • Commented on Why Perl 6 is different
    FWIW, it seems that I might be wholely unable able re-create Perl's "strict" or even stricter things in Ruby. Currently there's no idea of a pragma to affect a bit of compilation. I've got a bare idea of perhaps implementing...
Subscribe to feed Recent Actions from Josh ben Jore

Subscribe to feed Responses to Comments from Josh ben Jore

About 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 hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.