rewritten example of usage with plain old perl