in reply to Conditional including of a module

Have you tried this?
if ($excel_requested){ require Win32::OLE; }

Replies are listed 'Best First'.
Re^2: Conditional including of a module
by edwardo_ (Initiate) on May 14, 2009 at 23:37 UTC
    Thanks for all who responded, apologies, could not posted earlier.
    The above suggestion worked only when I removed requirement for Win32::OLE::Const 'Microsoft Excel' , which I used earlier and thought I need.
    Apparently in this case writing to excel worked without that addition, when earlier for some reason it couldn't.
    Thanks again.