Skip to content

Instantly share code, notes, and snippets.

@sukima
Created June 19, 2011 04:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sukima/1033749 to your computer and use it in GitHub Desktop.
Simple Perl OOP Hello World Example
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