use Data::Dump qw/pp/; #... if ( -s $file and ! $do_rebuild ) { warn "reading cache"; $h_func_pod = do $file; #warn pp '$h_func_pod: ', $h_func_pod; } else { # rebuild cache $h_func_pod = parse_by_process(); warn "dumping to cache"; open my $cache, '>', $file; print $cache ( '+' . pp $h_func_pod); # +{ is never a block close $cache; }