No no warnings; because I use 5.005.
use constant CONSTANT => "value"; is better for
any code where
the difference might matter. For simple & well contained
code I have the bad habit of
my $VAR = "value"; # XXX constant
Definitely my ($foo, $bar) = @_; this is crystal clear
and screen space is valuable. I do find that I don't use
my ($foo, $bar, @valuable) = @_; though.
Regarding for ( @array) versus foreach (@array) , I don't
care much. I use foreach for this and use for for C-style loops.
I'd nearly never use $_ here. I rarely use implicit $_
except for the most common idioms. Though I'm usually
using Perl I don't want to develop overly specialized finger
habits.
Always print 'foo'; I don't follow print
statements with
more code on the same line.
Breaking the C habit of using qq quotes had some appeal.
Then I coded a lot of print statements. qq usage is more
flexible, save q for when you have to use it.
glob '*' or <*>
I would lean toward glob but I have not used either construct.
Again <FOO> is the standard idiom.
I find keys is the most natural way to go through a hash.
In reply to Re: Style, style, style
by rir
in thread Style, style, style
by Juerd
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |