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.