But that's DBI and prepare_cached, not a file or directory handle. Note that file and directory handles are resources Perl can natively deal with, while other handles allocated in an external process are not.
Makeshifts last the longest.
Comment on Re^6: problems returning from recursive subroutine (dbi handle != dir/file handle)