As far as I can tell,
if (1==1) { } is being used as an alternative to commenting out the lines. While this may provide a simple way to skip a block of code by changing a single character, there appears to be a performance detriment:
#!/usr/bin/perl -w
use strict;
if (1==1) { 1; }
| $ perl -MO=Deparse equal
BEGIN { $^W = 1; }
use strict 'refs';
do {
'???':
};
|
#!/usr/bin/perl -w
use strict;
if (0==1) { 1; }
| $ perl -MO=Deparse unequal
BEGIN { $^W = 1; }
use strict 'refs';
do {
'???'
};
|
#!/usr/bin/perl -w
use strict;
if (1==0) { 1; }
| $ perl -MO=Deparse unequal2
BEGIN { $^W = 1; }
use strict 'refs';
do {
'???'
};
|
#!/usr/bin/perl -w
use strict;
1;
| $ perl -MO=Deparse uncommented
BEGIN { $^W = 1; }
use strict 'refs';
'???':
|
#!/usr/bin/perl -w
use strict;
# 1;
| $ perl -MO=Deparse commented
BEGIN { $^W = 1; }
|
UPDATE: Added the if (1==1) { } corollary