elfdump writes "Tilly, one of the Perl Monks, has been threatened with lawsuits from his employer for performing open-source development. His company claims ownership on all of the GPL'd work he has performed since he was hired, including rights to portions of the Carp and Exporter modules. In addition to his code being pulled, Tilly's revolutionary ideas on regular expression engines (1, 2) may now never be fulfilled. In this statement, Tilly warns open-source developers of the dangers of the "work for hire" provision in contracts, which entitles a company to all of its employee's intellectual products, regardless of their applicability to the company or whether or not the ideas were developed on work time. Definitely something to consider if you perform OSS development." One thing to clarify: your employer does not own everything you do by law - only by the contract you may have signed. Brief rant below.
A lot of people think they have no negotiating ability. You do. When you're thinking of signing on with some company, and they send you a boiler-plate contract to sign, don't just sign it and send it back. Read it carefully. Alter it as you see fit, striking out sections, adding sections, and initialing each change. Then sign it, make a copy for yourself, and send it back.
Where it says:
company owns the rights to all work produced during the term of employment
Just strike it out, and change it to:
company owns the rights to code written during working hours and in direct furtherance of any tasks assigned by the company
See how much nicer that reads? Now, when you do this, there are two possibilities: either the company will ignore it and hire you, or they will object to your alteration of the contract. In the second case, if they stand firm on the boiler-plate contract, I suggest you simply ask for more money - for instance, if you were expecting an 8 hour/day job and their contract asserts that they own what you do 24 hours/day, then you'll need at least three times as much salary to compensate.
And if you and the company cannot reach an agreement, well, maybe you didn't want to work for them anyway. If they're already screwing you before you've even signed on, that's not a good omen.
There's already some good advice in the comments on the perlmonks story, so I'll leave it at that.