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