my $struct = pack "LLLpLLLpLpLppLIppLLpILL", ( 88, #'lStructSize' # DWORD $Handle, #'hwndOwner' # HWND 0, #'hInstance' # HINSTANCE $lpstrFilter, #'lpstrFilter' # LPCTSTR 0, 0, # $lpstrCustomFilter, #'lpstrCustomFilter' # LPTSTR # length $lpstrCustomFilter, #'nMaxCustFilter' # DWORD #I'm not able to make it work with CustomFilter $nFilterIndex, #'nFilterIndex' # D +WORD $lpstrFile, #'lpstrFile' # LPTSTR length $lpstrFile, #'nMaxFile' # DWORD $lpstrFileTitle, #'lpstrFileTitle' # LPTSTR length $lpstrFileTitle, #'nMaxFileTitle' # DWORD $lpstrInitialDir, #'lpstrInitialDir' # LPCTSTR $lpstrTitle, #'lpstrTitle' # LPCTSTR $Flags, #'Flags' # DWORD 0, #'nFileOffset' # WORD # 0, #'nFileExtension' # WORD $nFileExtension, #'nFileExtension' # WORD $lpstrDefExt, #'lpstrDefExt' # LPCTSTR 0, #'lCustData' # DWORD 0, #'lpfnHook' # LPOFNHOOKPROC $lpTemplateName #'lpTemplateName' # LPCTSTR , 0, 1 );