add perl version memento pattern