the file that is being sent from my function gets copied into FILEHANDLE. thats what i want it to do. however if there is an error myfunction() returns undef. my question is how do i check if it is returning the filehandle or undef? in order to copy the file or display the error message?