A class is really just a package : Class Definition « Class « Perl






A class is really just a package

  

#!/bin/perl
package main;

$name = "Tom";
my $birthyear = 1942;

package nosy;
print "$main::name.\n";
print "$main::birthyear?\n";

   
    
  








Related examples in the same category

1.A Perl class is a package containing a collection of variables and functions, called properties and methods.
2.Cat class and dog class