public
Last active

Simple Perl OOP Hello World Example

  • Download Gist
perl_helloWorld.pl
Perl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.