Your question's far too vague to answer directly but:
- Load any existing state (see below)
- Use alarm to setup an alarm for 10 seconds, and put a suitable $SIG{ALARM} handler in place (see perldoc -f alarm)
- Wrap whatever is doing your work inside an eval {}
- Checkpoint whatever state you need to resume (using Storable, Data::Dumper, YAML, or maybe even DBI or Class::DBI)
- Use exec $0, @args to restart yourself.
Of course you might also want to look into using something like cron instead to start yourself periodically, although most implementations only have minute resolution (not second).