Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

+ -

  Journal: The mod_perl debugger you've always wanted on 2010.07.22 12:53

Journal by jjore on 2010.07.22 12:53
User Journal

"The mod_perl debugger you've always wanted" is on my new blog at:

Read More 0 comments

+ -

  Comment: I need a launcher too (Score 1) on 2010.07.07 8:55

by jjore on 2010.07.07 8:55 (#72150)
Attached to: The next challenge for Perl on Windows (et al)

I need a system tray launcher too. I realized today that my newest work in the perl debugger really wants a desktop component so that I can just keep my running debugger multi-prompt going and ready for new connections, etc but have an appropriate UI to it.

Read More 2 comments
Comments: 2
+ -

  Journal: Unicode in Perl, FTW (Я очень ра on 2010.07.07 1:01

Journal by jjore on 2010.07.07 1:01

+ -

  Journal: Under the covers of perldoc on 2010.07.07 0:44

Journal by jjore on 2010.07.07 0:44

+ -

  Comment: Bitwise operators? (Score 1) on 2010.06.01 22:17

Hey, what's with the bitwise operators? Would ordinary boolean operators work here or are you doing this for some invisible-to-me precedence reason?

Read More 6 comments
Comments: 6
+ -

  Journal: JVM's -XX:-DontCompileHugeMethods & dynamic languages on 2010.05.26 17:02

Journal by jjore on 2010.05.26 17:02
User Journal

In html which I just picked out of's front page I notice there's an ordinary 8K bytecode size limit for JVM heuristics.

Allegedly adding -XX:-DontCompileHugeMethods to the command line eliminates this limit.

Read More 0 comments

+ -

  Comment: Pragma? Monkey patching? (Score 1) on 2010.05.23 22:17

Hi, this API is lacking. You're modifying state and expecting it to get used elsewhere and maybe it or maybe it won't or maybe something else now will fall over because things are possibly "strange."

Further, there's little reason for a user to think that loading something that looks like a class isn't going to be the normal sort of idempotent action we normally expect "Yes please, this I require that class X be loaded".

Quite sure this use of use() ought to look unlike a regular class-loading use of use(). Or the class loading could load HomeDir but replace it's environmental db with something custom?

Perhaps something like:

sub import {
    $File::HomeDir::ENV = {
        HOME => ...

Read More 1 comments
Comments: 1
+ -

  Comment: Re:I like, I like... (Score 1) on 2010.05.09 16:19

by jjore on 2010.05.09 16:19 (#71977)
Attached to: Stop the debugger when a test fails

How about this?

use Debugger::OnTestFailures
    -src_rx => qr/^Test::/;

Read More 4 comments
Comments: 4
+ -

  Journal: Stop the debugger when a test fails on 2010.05.09 12:43

Journal by jjore on 2010.05.09 12:43
User Journal

I was debugging some test failures earlier this morning but they were in the middle of a long test script. I thought it'd be nice if I could step through the test with the debugger and just stop whenever a test failed.

Here's the result. A test failure immediately followed by being in the debugger:

not ok 236
14:                    return $result;

Read More 4 comments
Comments: 4
+ -

  Comment: Zeus zxtm (Score 1) on 2010.03.27 13:11

by jjore on 2010.03.27 13:11 (#71802)
Attached to: On the bright side...

I use Zeus zxtm's SOAP API. IIRC, when I look at the wrong place I get documentation like "this is a char[]". The SOAP API documentation does actually get around to naming what the available keys are. Thus far I've never actually had to resort to reverse engineering because the entire API really did seem to be documented (if lightly fragmented).

I'm using using WSDLs from Rake in Ruby. Works fine.

Read More 3 comments
Comments: 3
+ -

  Comment: Re:fun! (Score 1) on 2010.01.11 13:15

by jjore on 2010.01.11 13:15 (#71516)
Attached to: Attaching to a process and calling a kernel function

I made it into a shell script so I'd have a working groups program since Mac OS X 10.6.2 has a "wrong" version. The shell script is dumb and just assumes it's ok to read 32 ints.

cat >/tmp/groups.gdb <<EOF
  print \$ngroups = (int)getgroups(0,0)
  set \$groups = (int*)malloc(4092)
  set \$ngroups = (int)getgroups(\$ngroups,\$groups)
  x/32d \$groups
  call (void)free(\$groups)
gdb -x /tmp/groups.gdb -p $1

Read More 2 comments
Comments: 2
+ -

  Comment: Re:That code is painful to read (Score 1) on 2010.01.10 17:36

by jjore on 2010.01.10 17:36 (#71512)
Attached to: Decoding multiple encoded utf-8 in perl or ruby

Ah. Ok, it works provided the value is valid UTF-X, Perl's more permissive variant of UTF-8. When I'd tried your snippet I copied my original post but the rendered blog post had a space inserted into the middle of the string which made the value no longer be valid UTF-X.

Also, utf8::decode returns a boolean indicating whether it did anything. Presumable this means your function should read as follows. This leaves both the interpretation of the string up to Perl and also lets us eventually abort when there's no more work to be done according to perl.

1 while utf8::decode( $str );

As a note, utf8::decode is implemented by sv_utf8_decode of sv.c which will abort when the string stops being valid UTF-X.

Read More 7 comments
Comments: 7
+ -

  Comment: Re:That code is painful to read (Score 1) on 2010.01.09 1:04

by jjore on 2010.01.09 1:04 (#71508)
Attached to: Decoding multiple encoded utf-8 in perl or ruby

Actually, that would apparently work if the value being decoded were fully valid but it doesn't because the input was an abuse of Unicode.

Read More 7 comments
Comments: 7
+ -

  Comment: Re:That code is painful to read (Score 1) on 2010.01.09 0:59

by jjore on 2010.01.09 0:59 (#71507)
Attached to: Decoding multiple encoded utf-8 in perl or ruby

That doesn't work. I didn't know it was supposed to.

Read More 7 comments
Comments: 7
+ -

  Comment: Re::utf-8 ? (Score 1) on 2010.01.09 0:14

by jjore on 2010.01.09 0:14 (#71505)
Attached to: Unicode URLs, wtf?

Nope. I'd never noticed the option. My bad!

Read More 5 comments
Comments: 5