以下是使用定义在Perl中初始化标量变量的最佳方式吗?
my $var; if (cond) { $var = "string1"; } # Is this the correct way? if (defined $var) { ... }
my $var; if (cond) { $var = "string1"; } # Is this the correct way? if (defined $var) { ... }