Skip to content

Instantly share code, notes, and snippets.

@afeinberg
Created January 14, 2010 02:36
Show Gist options
  • Save afeinberg/276800 to your computer and use it in GitHub Desktop.
Save afeinberg/276800 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl -w
package Foo;
use strict;
sub new {
my $class = shift;
my $foo = shift;
my $self = { foo => $foo };
return bless $self, $class;
}
sub bar {
my $self = shift;
print "foo = " . $self->{foo} . "\n";
}
1;
package main;
use strict;
my $foo = Foo->new('blah');
$foo->bar();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment