my $config = GlobalConfig->new; # compile-time error if ( $config->mis_dbtype = 'db2' ) { ... } # This works if ( $config->mis_dbtype == 'db2' ) { ... }