One container of paint is exactly enough to cover the inside of an old rectangle which is three times as long as it is wide.  If we make a new rectangle by shortening the old rectangle by $18$ feet and widening it by $8$ feet as shown below, one container of paint is also exactly enough to cover the inside of the new rectangle.  Find the length in feet of the perimeter of the new rectangle.

[asy]
size(250);
defaultpen(linewidth(0.8));
draw((-2,0)--(-2,5)--(13,5)--(13,0)--cycle^^(16,-1)--(16,6)--(27,6)--(27,-1)--cycle^^(9,5)--(9,0)^^(16,4)--(27,4));
path rect1=(13,5)--(13,0)--(9,0)--(9,5)--cycle,rect2=(16,6)--(16,4)--(27,4)--(27,6)--cycle;
fill(rect1,lightgray);
fill(rect2,lightgray);
draw(rect1^^rect2);
[/asy]
1. Let the width of the old rectangle be \( x \). Then, the length of the old rectangle is \( 3x \) because it is given that the length is three times the width.
2. The area of the old rectangle is:
   \[
   \text{Area}_{\text{old}} = x \cdot 3x = 3x^2
   \]
3. For the new rectangle, the length is shortened by 18 feet and the width is increased by 8 feet. Therefore, the new dimensions are:
   \[
   \text{Length}_{\text{new}} = 3x - 18
   \]
   \[
   \text{Width}_{\text{new}} = x + 8
   \]
4. The area of the new rectangle is:
   \[
   \text{Area}_{\text{new}} = (3x - 18)(x + 8)
   \]
5. Expanding the expression for the area of the new rectangle:
   \[
   (3x - 18)(x + 8) = 3x^2 + 24x - 18x - 144 = 3x^2 + 6x - 144
   \]
6. Since one container of paint covers both the old and the new rectangle, their areas must be equal:
   \[
   3x^2 = 3x^2 + 6x - 144
   \]
7. Subtract \( 3x^2 \) from both sides to simplify:
   \[
   0 = 6x - 144
   \]
8. Solving for \( x \):
   \[
   6x = 144
   \]
   \[
   x = 24
   \]
9. Substitute \( x = 24 \) into the dimensions of the new rectangle:
   \[
   \text{Length}_{\text{new}} = 3(24) - 18 = 72 - 18 = 54
   \]
   \[
   \text{Width}_{\text{new}} = 24 + 8 = 32
   \]
10. The perimeter of the new rectangle is:
    \[
    \text{Perimeter}_{\text{new}} = 2(\text{Length}_{\text{new}} + \text{Width}_{\text{new}}) = 2(54 + 32) = 2 \cdot 86 = 172
    \]

The final answer is \( \boxed{172} \).