add in this dodgy perl code