Created
June 19, 2011 04:07
-
-
Save sukima/1033749 to your computer and use it in GitHub Desktop.
Simple Perl OOP Hello World Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package HelloWorld; | |
sub new | |
{ | |
my $class = shift; | |
my $self = { }; | |
bless $self, $class; | |
return $self; | |
} | |
sub print | |
{ | |
print "Hello World!\n"; | |
} | |
package main; | |
$hw = new HelloWorld(); | |
$hw->print(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment