# use Constants use constant EXCEL => 'Excel.Application'; use constant WORD => 'Word.Application'; my $excel = Win32::OLE->GetActiveObject(&WORD) #### #Use another package package MSApps; { our $MSApps::EXCEL = 'Excel.Application'; our $MSApps::WORD = 'Word.Application'; } ## Then use MSApps; my $excel = Win32::OLE->GetActiveObject($MSApps::EXCEL) #### #Do the most simple thing: create variables. my $EXCEL = 'Excel.Application'; my $WORD = 'Word.Application'; my $excel = Win32::OLE->GetActiveObject($WORD)