in reply to using lexically scoped variable as a filehandle

$sym = gensym; open($sym, "filename");

If you see code like that, I think it was for old versions of perl (I belive pre-5.6) where filehandles couldn't be autovivified, so you had to create a glob with gensym or open would complain.