ported python examples to perl