use strict; use warnings; use Win32; use Win32::GUI(); use Win32::API; Win32::API->Import('kernel32','BOOL SetConsoleIcon(HWND icon)'); eval{SetConsoleIcon( Win32::GUI::Icon->new('box1.ico')->{-handle});}; #eval 2 counter the die from undef return from "new" with "->" print 0+$^E; print " ---\n".'$^E = '; #separated \n just in case print $^E; print " ---\n".'$! = '; print $!; print " ---\n".'$@ = '; print $@; print " ---\n".'FormatMessage = '; print Win32::FormatMessage(Win32::GetLastError()); sleep 50; exit;