in reply to Silly question about function args

You might want to take a look at Inline::C on CPAN. It allows you to embed C source directly in your perl script. I suppose that calling a C function this way takes longer than calling a perl subroutine, so you should probably implement a whole loop in C and call that function only a few times.