use strict; use warnings; BEGIN {   $main::debug = defined $ARGV[0] ? $ARGV[0] : 0; } use if $main::debug, "Data::Dumper"; my $ref = {foo=>'bar'}; print Dumper($ref)   if $main::debug;