Skip to content

Instantly share code, notes, and snippets.

@anazawa
Created February 16, 2012 16:50
Show Gist options
  • Select an option

  • Save anazawa/1846400 to your computer and use it in GitHub Desktop.

Select an option

Save anazawa/1846400 to your computer and use it in GitHub Desktop.
Blosxom::Header::Object
package Blosxom::Header::Object;
sub new {
my ( $class, %method ) = @_;
while ( my ( $method, $code_ref ) = each %method ) {
next if ref $code_ref ne 'CODE';
my $slot = __PACKAGE__ . "::$method";
{
no strict 'refs';
*$slot = $code_ref;
}
}
return bless \do { my $anon_scalar }, $class;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment