Help for this page

Select Code to Download


  1. or download this
    package House; # Class
    sub new { # Class method called a constructor
      my $class = shift;
    ...
    return $ref;  # A reference to the object is returned
    }
    1;
    
  2. or download this
    #!/usr/bin/perl -w
    use lib ("/home/hamidjon/Perl/Learning/code_examples/myModules");
    use House;
    my $houseref = House->new();
    
    print "\$houseref in main belongs to class ", ref($houseref), "\n";