add perl version simple-factory pattern