in reply to Re: Hash from package
in thread Hash from package

so how can i use that with my original post?:
my %hash = qw(Engine 1800cc Doors 4 Color blue); for my $key (keys %hash){ print "$key -> $hash{$key}\n"; }

Replies are listed 'Best First'.
Re^3: Hash from package
by wfsp (Abbot) on Jan 04, 2007 at 09:45 UTC
    for my $key (keys %{$car}){ print "$key -> $car->{$key}\n"; }
    Directly accessing the attributes of an object like that would likely be considered poor form.

    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

      thanks man, ive been looking all day for some info on perl objects. much appreciated!