Depends how you want to do it. I personally use
fetchmail in conjunction with some procmail rules
to get mail from a single
remore mailbox and deliver it into multiple
local mailboxes. You could
do the same yourself in perl
using the Net::POP3 module for
retrieval and Net::SMTP for local delivery.
There are other alternatives too.