Skip to content

Instantly share code, notes, and snippets.

@gphat
Created July 12, 2009 16:29
Show Gist options
  • Save gphat/145683 to your computer and use it in GitHub Desktop.
Save gphat/145683 to your computer and use it in GitHub Desktop.
package Foo;
use strict;
use warnings;
sub new {
my $class = shift;
my $self = {};
$self->{"name"} = undef;
return bless($self, $class);
}
sub name {
my $self = shift;
my $name = shift;
if(defined($name)) {
$self->{"name"} = $name;
}
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment