my $info_ref = eval $dumper; if( $@ ) { ## Similar notes about what you log apply here too, but . . . warn qq{Problem during dumper eval: $@\n}; } else { %info = %{ $info_ref }; ## Or just use $info_ref->{blah} rather than $info{blah} }