18 lines
428 B
Perl
18 lines
428 B
Perl
|
# Module: House.pm
|
||
|
package House; # Class
|
||
|
|
||
|
sub new { #constructor
|
||
|
my $class = shift;
|
||
|
my $ref={"Owner"=>undef,
|
||
|
"Price" =>undef,
|
||
|
};
|
||
|
bless($ref, $class);
|
||
|
return $ref; # A reference to the object is returned
|
||
|
}
|
||
|
1;
|
||
|
|
||
|
# The User of the Module)
|
||
|
#!/usr/bin/perl
|
||
|
use House;
|
||
|
my $houseref = House->new();
|
||
|
print ref($houseref),".\n";
|