V
Victor Porton
What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
use constant X=>(1,2);
or
use constant X=>[1,2];
What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
Victor Porton said:What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
TonyV said:What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
Honestly? The best practices I've read say that the best of all is:
my @X = (1, 2);
TonyV. Honestly, first you should read
perldoc constant
so you understand what it provides, before you comment
on what's the 'best'.
Actually, what I read a long time ago was O'Reilly's "Perl Best
Practices," section 4.5: Use named constants, but don't use
"constant". (I.e. the constant pragma.) It follows with several good
Actually, many experienced and knowledgeable hackers beg to differ
with some PBP item or another: after all it's just a list of
suggestions. While some of the points they make are perfectly fine,
constant.pm *does* have its use.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.