Some general points about investing & the reinvestment of dividends with respect to the model you use (nothing to do with Perl).
stock prices are not constant, it might be $100 right now but how about 3 years from now?
dividend is not constant, typically you would like to see dividend go up over time:)
reinvestment of dividend... "cash is king!" Personally I don't reinvest dividends (in the same stock) unless I get something extra out of it, like a DRIP but only when it offers me some additional advantage. I would like to decide for myself at what price I buy a stock!
CountZero raises an interesting point, some brokers allow you to buy fractions of shares, not just mutual funds but of specific stocks as well.
So I suggest to complicate things:)
Model the volatility of the stock and the (slight) increase of dividends over time.
Maybe factor in the buying of fractions of stocks?
A bare number some years from now doesn't mean anything, if you want a more meaningful number you will have to take into account costs (your broker), taxes (sigh) and inflation.
Cheers,
Harry