Caveat: if you're in controlled airspace, you must remain VFR (not just be able to avoid the terrain--there's a difference) until you get your clearance, if you're going to do a pop-up.
The old way that still works is (assuming you have some sort of phone service) filing the IFR flight plan on the ground, with a clearance void time. I learned the hard way to ask for longer than ATC wanted to arbitrarily give me, and for me, 20 minutes worked pretty well if I already had the airplane preflighted and loaded. That way you're actually on the IFR flight plan and are legal in the soup because you have your clearance, even before you make contact on the radio with ATC.
If on the other hand you're not in controlled airspace at all, it's legal to go into IMC so long as you and the airplane are current for IFR, and so long as you can do it safely. There are fewer and fewer places where that can be done, but in the old days, I did it frequently, pre-cellphone, when I flew home from visiting my folks at Sundance, WY. Once I could make contact with either Sheridan FSS or Denver Center, I'd file in the air and get my clearance, although I'd been in the clouds legally for awhile.
Cary