- while (<>) { ... } or while (my $line = <>) { ... }
The former, unless the code is complex enough warrant explicit readability.
- -w or use warnings;
The former, although i am slowly gravitating to the latter.
- sub CONSTANT () { ... } or use constant CONSTANT => ...;
The latter, it just looks nicer to me.
- my ($foo, $bar) = @_; or my $foo = shift; my $bar = shift;
- for (@array) { ... } or foreach (@array) { ... }
The former, since they are really the same (barring readability issues), why type more?
- print 'foo'; or print('foo');
The former, unless the print becomes complex enough that parens are necessary, which is not that often for me.
- 'simple string'; or "simple string"
The former, i try to only use double quotes when i need something interpolated.
- glob '*' or <*>
The former, until it bites me and i resort the latter. :D
- readline *FOO or <FOO>
The former, until it bites me and i resort the latter ;)
- for (keys %foo) { $_ and $foo{$_} } or while (my ($key, $value) = each %foo) { $key and $value }?
Depends. If the value is more than a simple scalar or i find my self using the values a lot then i will strongly consider the latter.
Here is one i have been contemplating lately:
print "$foo\n"; or print $foo,$/;
:)
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)