The perimeter of a rectangle can be thought of as 2l+2w=p. That is, twice the length added to twice the width is equivalent to the perimeter. So a single length plus a single width equals 1/2 a perimeter. So, l+w=12.
Now find two numbers that add to 12 and you are done.
Here's an example:
Length: 7
Width: 5