in reply to protect excel file in perl script

If I understand your question correctly, you are trying to open the password protected excel file and parse it,
Use Win32::OLE module and try this. my $sheet = $Excel->Workbooks->Open( { FileName => $filetoread, Password => $pas +s } );