ugh, writing Perl. Or rather, writing C in Perl to get the job done ;-)

@williballenthin