C:\Users\Peter>perl -Mstrict -le "my $x; $x = 0 or die $x"
0 at -e line 1.
####
C:\Users\Peter>perl -MO=Deparse -Mstrict -le "my $x; $x = 0 or die $x"
BEGIN { $/ = "\n"; $\ = "\n"; }
use strict;
my $x;
die $x unless $x = 0;
-e syntax OK
####
C:\Users\Peter>perl -MO=Deparse -Mstrict -w -E "sub false { 0 } my $x=false or die 'Died'; say 'not reached';"
BEGIN { $^W = 1; }
use strict;
use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'postderef_qq', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval';
sub false {
0;
}
die 'Died' unless my $x = false();
say 'not reached';
-e syntax OK
####
C:\Users\Peter>perl -Mstrict -w -E "sub false { 0 } my $x; $x=false or die 'Died',$x; say 'not reached';"
Died0 at -e line 1.
####
C:\Users\Peter>perl -MO=Deparse -Mstrict -w -E "sub false { 0 } my $x=false || die 'Died',$x; say 'not reached';"
Global symbol "$x" requires explicit package name (did you forget to declare "my $x"?) at -e line 1.
-e had compilation errors.
BEGIN { $^W = 1; }
use strict;
use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'postderef_qq', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval';
sub false {
0;
}
my $x = false() || die('Died', ${'x'});
say 'not reached';
C:\Users\Peter>perl -MO=Deparse -Mstrict -w -E "sub false { 0 } my $x; $x=false || die 'Died',$x; say 'not reached';"
BEGIN { $^W = 1; }
use strict;
use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'postderef_qq', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval';
sub false {
0;
}
my $x;
$x = false() || die('Died', $x);
say 'not reached';
-e syntax OK
####
C:\Users\Peter>perl -MO=Concise,-terse,-exec -Mstrict -w -E "sub false { 0 } my $x=false || die 'Died'; say 'not reached';"
OP (0x2a1c6b8) enter
COP (0x2a85b00) nextstate
OP (0xfdfb00) pushmark
PADOP (0xfdfac0) gv IV (0x105fb40) \&main::false
UNOP (0x2a85cf0) entersub
LOGOP (0x2a85be8) or
OP (0x2a85c78) pushmark
SVOP (0x2a85cb0) const [4] PV (0x105f618) "Died"
LISTOP (0x2a85c30) die [3]
OP (0xfdfb40) padsv [1]
BINOP (0x2a85b60) sassign
COP (0x2a85998) nextstate
OP (0x2a85a40) pushmark
SVOP (0x2a85a78) const [5] PV (0x105f5b8) "not reached"
LISTOP (0x2a859f8) say
LISTOP (0x2a85ab8) leave [1]
-e syntax OK
C:\Users\Peter>perl -MO=Concise,-terse,-exec -Mstrict -w -E "sub false { 0 } my $x=false or die 'Died'; say 'not reached';"
OP (0x2a249d8) enter
COP (0x2a76030) nextstate
OP (0xfc08e0) pushmark
PADOP (0xfc08a0) gv IV (0x103e770) \&main::false
UNOP (0x2a76220) entersub
OP (0xfc0920) padsv [1]
BINOP (0x2a761d8) sassign
LOGOP (0x2a760d0) or
OP (0x2a76160) pushmark
SVOP (0x2a76198) const [4] PV (0x103e1e8) "Died"
LISTOP (0x2a76118) die [3]
COP (0x2a75ec8) nextstate
OP (0x2a75f70) pushmark
SVOP (0x2a75fa8) const [5] PV (0x103e248) "not reached"
LISTOP (0x2a75f28) say
LISTOP (0x2a75fe8) leave [1]
-e syntax OK