in reply to what is filehandle's data type
It's a GLOB:
use strict; use warnings; my $str; open my $fileHandle, '>', \$str; print ref $fileHandle; [download]
Prints:
GLOB [download]
\*FH passes a reference to a GLOB to function.