Created
March 24, 2018 04:55
-
-
Save jgrar/f610d125544c5f8a0e62d7ddec4d948a to your computer and use it in GitHub Desktop.
Corrected week 6 basic OOP 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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use FindBin qw($RealBin); | |
use lib $RealBin; | |
use trivial; | |
my $obj1 = new trivial; | |
my $obj2 = trivial->new; | |
$obj1->printmsg; | |
printmsg $obj2; |
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 trivial; | |
use strict; | |
our $VERSION = 1.00; | |
sub new { | |
bless {}; | |
} | |
sub printmsg { | |
print "I'm trivial!\n"; | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment