Skip to content

Instantly share code, notes, and snippets.

@shibayu36
Created November 15, 2011 07:52
Show Gist options
  • Save shibayu36/1366418 to your computer and use it in GitHub Desktop.
Save shibayu36/1366418 to your computer and use it in GitHub Desktop.
package Sample::Accessor;
use strict;
use warnings;
use base qw(Class::Accessor::Fast);
__PACKAGE__->mk_accessors(qw(hoge fuga));
sub new {
my ($class, $args) = @_;
# hogehoge
return $class->SUPER::new($args);
}
1;
package main;
my $accessor = Sample::Accessor->new({hoge => 'hoge', fuga => 'fuga'});
use Data::Dumper;
warn Dumper($accessor);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment