in reply to Upload an image file
What the "copy up but is of size 0" typically means is that you are not writing anything to it.
Looking at "IN" I can see why, you are opening that with a "write pipe", meaning that you are truncating your in file. Using warnings or -w should have caught this. (well, it would have caught the use of an unitialized variable in the while loop)
So, your loop is empty, and nothing gets printed. Open with
open (IN, "<$file") || die "Could not read $file, $!"
Note the die statement there, that is ALWAYS a good idea when opening.