Directly accessing the attributes of an object like that would likely be considered poor form.for my $key (keys %{$car}){ print "$key -> $car->{$key}\n"; }
Have a look through the docs and look out for 'getters' and 'setters'.
Object-Oriented Tutorial specifically discusses getters and setters.
updated: added link to tutorial
In reply to Re^3: Hash from package
by wfsp
in thread Hash from package
by Yoda_Oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |