Skip to content

Instantly share code, notes, and snippets.

@tobyink
Created March 23, 2013 21:53
Show Gist options
  • Select an option

  • Save tobyink/5229512 to your computer and use it in GitHub Desktop.

Select an option

Save tobyink/5229512 to your computer and use it in GitHub Desktop.
package Local::Overloaded {
use overload
'&{}' => sub { sub { print "ok\n" } },
fallback => 1;
}
package Local::Class {
use Moo;
has a => (is => "ro", isa => bless([], "Local::Overloaded"));
}
Local::Class->new(a => 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment