in reply to sprintf problem

Why not use a proven tool like perltidy rather than reinventing the wheel?