I would like to extract date and time out of a binary file and convert it to ASCII in Perl.

How do I convert the binary data into an integer and into ASCII characters?
I have tried the code below, but it seems like I can only print out the first two bytes and then I only see zeroes for the next iterations. Occasionally, I do get other values, but it seems like I am not doing the conversion correct and missing some information.
while (( $n = read FILE, $data, 4) != 0 ) {my $hex = sprintf('%04X', ord($data))}
Is there some kind of conversion to integer that must take place? How do I convert this correctly?
Edit: In the hex dump I need to convert 04FF into an integer.