http://qs321.pair.com?node_id=11149430


in reply to Re^4: Image magic creation of thumb fail
in thread Image magic creation of thumb fail

"Hm don't see what's wrong within open and die,"

It's nothing to do with the myriad of problems you've created for yourself, however I said

"use $! when calling die to tell you why the open failed."

So that if/when your code dies while opening, you actually print out the reason why, rather than just printing "error", without telling you what the error was.

The documentation for open and the other link I provided explain clearly why three argument open is preferred, and also illustrate the use of or die "Can't write file: $!"; described above.