Perl implimentation of Replay idea