in reply to Re^3: Module Announcement: Perl-Critic-1.01
in thread Module Announcement: Perl-Critic-1.01
So I guess you'd rather do
ormy $pointless_reference = $obj->getPosition(); my ($x, $y) = @$pointless_reference[0,1];
instead ofmy ($x, $y) = @{$obj->getPosition()};
right? Restricting myself to returning just one value just because most languages do not allow anything more seems silly to me. Especially compared to such dirty tricks as updating the values of some variables passed by reference or something.my ($x, $y) = $obj->getPosition();
To me bending backwards to always return a single scalar is a code smell. A code smell sugesting that the author writes C or some other language, but definitely not Perl. Even though the code is full of sigils and there are regexps scattered around.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Module Announcement: Perl-Critic-1.01
by Rhandom (Curate) on Jan 29, 2007 at 19:07 UTC | |
by Jenda (Abbot) on Jan 29, 2007 at 22:43 UTC |