Patrick's perl stuff