The perimeter \( P \) of a rectangle is calculated using the formula:
\[ P = 2 \times (\text{length} + \text{width}) \]
Given that the length \( L \) of the rectangle is 12 meters and the width \( W \) is 5 meters, we plug these values into the formula:
\[ P = 2 \times (12 + 5) \]
\[ P = 2 \times 17 \]
\[ P = 34 \text{ m} \]
Therefore, the perimeter of the rectangle is 34 meters. The correct answer is:
D. 34 m