in reply to Re^4: Module Announcement: Perl-Critic-1.01
in thread Module Announcement: Perl-Critic-1.01
Depending upon the interface I think that it may be better to return a point reference or object rather than the xy coordinates themselves.my ($x, $y) = @{ $obj->getPosition }
my $point = $obj->getPosition; do_something_with_point($point); printf "X is %.2f\n", $point->x; # or maybe $point->[0] - possibly bad # or maybe $point->{x} - probably bad # but really $point->x is the best
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Module Announcement: Perl-Critic-1.01
by Jenda (Abbot) on Jan 29, 2007 at 22:43 UTC |