Although I personally would prefer to use Win32:OLE, that might not be an option for the OP based on the first line of code (#!/usr/bin/perl), which would seem to indicate that he/she is on a *nix like OS instead of Windows. If that's true, then Win32::OLE can't be used.