D
Dr.Ruud
Abigail schreef:
Thanks for the examples. Yes, lexical dependencies should make the {}
stay.
I benchmarked "if (1) {print}" against "print if 1", and the speed of
the first was less, but less than 5% so.
[why Deparse keeps {} for a single statement]
$ perl -le 'my $x = "foo"; if (1) {my $x = "bar"} print $x'
foo
$ perl -le 'my $x = "foo"; my $x = "bar" if 1; print $x'
bar
$ perl -le 'my $x = "foo"; 1 and do {my $x = "bar"}; print $x'
foo
$ perl -le 'my $x = "foo"; 1 and my $x = "bar"; print $x'
bar
Thanks for the examples. Yes, lexical dependencies should make the {}
stay.
I benchmarked "if (1) {print}" against "print if 1", and the speed of
the first was less, but less than 5% so.