merge perl code