Python or perl for custom script