The 'slightly longer than you are tall' thing is basically a guide.
The reason being that a board that is shorter than you will be much more unstable and harder to paddle.
Essentially the longer the board, the easier it is to paddle/ catch waves/ stand up etc. So basically yes, you can ride a longboard.
There is another thing to take into account too. As you get better, there are different disciplines of surfing. The idea that as you progress your board gets shorter is not necessarily true.
LONGBOARDING - this is the 'old-school' mellow form of surfing. I say old-school but more and more people are getting into it again. It involves long, mellow turns, moving up and down the board, riding the nose etc. It is really cool.
SHORTBOARDING - this is what most people think of, this is the pro-tour/ aerials, frantic, smashing the lip etc. It's also very cool.
Even with shortboards though, the larger the waves, the bigger the board!
I started off on a 6'6 popout, progressed to a 6'6 custom board, which was super fast etc. Now though (8 years on) I've moved to a 7'5 mini-mal and it's by far the best fun/ board I've ever had!
My friend did similar with the shortboards and he now has a 6'8 thruster and a 9'6 longboard. He loves both!
at 5' tall I would look at starting with something between 7 & 8 ft long and quite wide. (Get a Mini-mal)
Whatever you get, get in the water as soon and as often as you can!