The following message is a combination of the output of
$ perl -MO=Deparse -wle 'my ($a) = 1;my $b = 2; (my $c) = 3;my ($d, $e
+) = (4, 5); (my $f, my $g) = (6, 7); (my($h, $i) = (8, 9));my $j; my
+($k);'
$ perl -MO=Concise -wle 'my ($a) = 1;my $b = 2; (my $c) = 3;my ($d, $e
+) = (4, 5); (my $f, my $g) = (6, 7); (my($h, $i) = (8, 9));my $j; my
+($k);'
- my ($a) = 1;
deparse: my($a) = 1;
concise:
7 <2> aassign[t2] vKS ->8
- <1> ex-list lK ->5
3 <0> pushmark s ->4
4 <$> const(IV 1) s ->5
- <1> ex-list lK ->7
5 <0> pushmark s ->6
6 <0> padsv[$a:1,7] lPRM*/LVINTRO ->7
- my $b = 2;
deparse: my $b = 2;
concise:
b <2> sassign vKS/2 ->c
9 <$> const(IV 2) s ->a
a <0> padsv[$b:2,7] sRM*/LVINTRO ->b
- (my $c) = 3;
deparse: my($c) = 3;
concise:
h <2> aassign[t5] vKS ->i
- <1> ex-list lK ->f
d <0> pushmark s ->e
e <$> const(IV 3) s ->f
- <1> ex-list lK ->h
f <0> pushmark s ->g
g <0> padsv[$c:3,7] lPRM*/LVINTRO ->h
- my ($d, $e) = (4, 5);
deparse: my($d, $e) = (4, 5);
concise:
p <2> aassign[t8] vKS ->q
- <1> ex-list lKP ->m
j <0> pushmark s ->k
k <$> const(IV 4) s ->l
l <$> const(IV 5) s ->m
- <1> ex-list lKPRM*/128 ->p
m <0> pushmark sRM*/128 ->n
n <0> padsv[$d:4,7] lRM*/LVINTRO ->o
o <0> padsv[$e:4,7] lRM*/LVINTRO ->p
- (my $f, my $g) = (6, 7);
deparse: my($f, $g) = (6, 7);
consise:
x <2> aassign[t11] vKS ->y
- <1> ex-list lKP ->u
r <0> pushmark s ->s
s <$> const(IV 6) s ->t
t <$> const(IV 7) s ->u
- <1> ex-list lKPRM* ->x
u <0> pushmark sRM* ->v
v <0> padsv[$f:5,7] lRM*/LVINTRO ->w
w <0> padsv[$g:5,7] lRM*/LVINTRO ->x
- (my($h, $i) = (8, 9);
deparse: my($h, $i) = (8, 9);
concise:
15 <2> aassign[t14] vKPS ->16
- <1> ex-list lKP ->12
z <0> pushmark s ->10
10 <$> const(IV 8) s ->11
11 <$> const(IV 9) s ->12
- <1> ex-list lKPRM*/128 ->15
12 <0> pushmark sRM*/128 ->13
13 <0> padsv[$h:6,7] lRM*/LVINTRO ->14
14 <0> padsv[$i:6,7] lRM*/LVINTRO ->15
- my $j;
deparse: my $j;
concise:
17 <0> padsv[$j:7,9] vM/LVINTRO ->18
- my ($k);
deparse: my $k;
concise:
19 <0> padsv[$k:8,9] vPM/LVINTRO ->1a
Summary:
- my ($a) = 1; and (my $c) = 3; are identical in the OPs it generates. Thus there is no difference in which one you use
- my ($a) = 1; and my $b = 2; are not identical. The generates OPs are different and so is the behaviour (as pointed out already)
- my ($d, $e) = (4, 5); and (my $f, my $g) = (6, 7); and (my($h, $i) = (8, 9)); are identical
- my $j; and my ($k); are identical in the OPs it generates. Thus there is no difference in which one you use
Updated: updated to include my $j; and my ($k);