Ever so slowly, the unemployed are getting hired. And if you're one of them, the next task will be to get your finances back on track.

The latest government figures show that the median length of unemployment is 51/2 months — enough time without a paycheck to do a lot of damage. By then, you might have wiped out savings, dipped into retirement accounts or racked up credit card debt. Your credit record could be tarnished if you were late paying bills or defaulted.

Getting back on sound financial footing will take some time — and a switch in mind-set.

"It's going from hunkering down to survival mode to getting back to planning for the future," says Christopher Brown, a Rockville financial planner.

Alan Birkelbach is doing just that after re-entering the work force last month. The 55-year-old computer analyst from Plano, Texas, was laid off in November after 23 years with his employer. His wife, a telecommunications engineer who has been on disability, lost her job the year before.

Their income following the layoffs — disability insurance, unemployment benefits and severance — was at least half what it was before, Birkelbach says.

The pair immediately cut expenses. "More beans instead of steaks. No vacations. We didn't go to the movies much," he says.

His new job pays around $80,000, or 10 percent less than he used to make. Even with a steady income, though, the two continue to watch their spending.

"It would have been easy to snap back like a rubber band, to go back to the old standard of living," Birkelbach says. But unemployment isn't something the couple will forget soon.

"It slapped us in the face, very effectively, that things are fragile and they can change at a moment's notice," he says.

If you've recently been rehired, here are some steps to get finances back in shape:

New job, new budget "Put together a budget as quickly as possible," advises Derrick Kinney, a financial adviser in Arlington, Texas. "It's important to make sure your budget fits your salary."

Indeed, you won't be able to use your old budget if the new job pays less than you earned before.

Replenish emergency fund Building up a cash cushion worth three to six months' worth of living expenses must be the top priority.

"If they don't build that emergency reserve and something happens with their new job, they will have no fallback position," says Grace Worley, an Indianapolis financial planner.

Pay off credit cards If you have card debt to repay, it's best for your wallet to tackle the balance with the highest interest rate first while keeping up with the minimum payments on the others.

But it's more rewarding psychologically for some people to pay off the smallest balances first. That way they wipe out some bills quickly and feel as if they are making progress.

The most important thing is that you continue chipping away at your debt, so choose the method that is most likely to keep you on course, Kinney says.

Save for retirement Enroll as soon as possible in your new employer's retirement plan. It might be difficult at first to save the maximum limit while, say, rebuilding an emergency fund, but contribute at least enough to get the employer match.

The last couple of years have been good in the stock market, and those who had been sitting on the sidelines might be tempted to catch up on retirement savings by investing aggressively in equities. But that's risky because stock prices can suddenly plunge. Remember 2008?