How I can emulate in my Perl code things like Ruby's "include"/"extend" mechanism?
Let's take for example the following code in Ruby:
module ActiveRecord
class Base
class << self
#...
end
#...
end
Base.class_eval do
include ActiveRecord::Persistence
extend ActiveModel::Naming
extend QueryCache::ClassMethods
extend ActiveSupport::Benchmarkable
extend ActiveSupport::DescendantsTracker
include ActiveModel::Conversion
include Validations
extend CounterCache
include Locking::Optimistic, Locking::Pessimistic
include AttributeMethods
...
end
end
It leads me to ask this question, because I can't find any clear idea during several days of researching. So, maybe there exists some good way to organize it in Perl?