1package Real; 2use Attribute::Handlers::Prospective; 3 4sub RealAttr : ATTR { 5 print "You ascribed a RealAttr attribute to $_[2]\n"; 6} 7 8sub AUTOATTR : ATTR { 9 print ">>> You tried to ascribe a :$_[3] attribute to $_[2]\n", 10 ">>> but there's no such attribute defined in class $_[0]\n", 11 ">>> (Did you mean :RealAttr?)\n"; 12} 13 14package main; 15 16my Real $thing : FakeAttr = 7; 17print "$thing\n"; 18