# perl
BEGIN {
$shbstatus = (-f "C:/shb") ? 1 : 0;
}
END {
$shbstatus ? print "shb identified\n"
: print "shb was not identified\n";
}
use warnings;
print "XYZ\n";
print "$shbstatus\n";
####
XYZ
1
shb existed
####
# perl
BEGIN {
my $shbstatus = (-f "C:/shb") ? 1 : 0;
}
####
XYZ
Use of uninitialized value in concatenation (.) or string at begin.pl line 15.
shb was not identified
####
# perl
use strict;
BEGIN {
$shbstatus = (-f "C:/shb") ? 1 : 0;
}
####
Global symbol "$shbstatus" requires explicit package name at begin.pl line 4.
BEGIN not safe after errors--compilation aborted at begin.pl line 5.
shell returned 9
####
# perl
BEGIN {
use strict;
}
BEGIN {
$shbstatus = (-f "C:/shb") ? 1 : 0;
}
####
XYZ
1
shb identified