in reply to convert some marco to perl
marto's writeups (in particular, Re: VBA to Perl) have excellent advice on converting VBA macros to Perl.
HTH,