http://www.perlmonks.org?node_id=1019193


in reply to Re^2: running string as perl script and pass into STDIN programatically
in thread running string as perl script and pass into STDIN programatically

AFAIU, both File::Temp and File::Tempdir destroy the apporpriate files/directories when their object comes out of scope (e.g. at the end of {} block where it was declared using my).
Sorry if my advice was wrong.