"Referer" is just another HTTP Request header :)
Just add this header with the value you want to your request and that's all.
UPDATE:jeffa requested to drop the example code as freak's history here isn't good at all ;)
Anyway, I'm sure googling for lwp referer would be (too) easy to get the answer he wants :(