Start by drawing lines AC and BC both of length L. Add line AD, parallel to BC and of length L, and add line BE, parallel to AC and also of length L. This creates two parallelograms, ABCD and ABEC, which share their base and have a common point C on top. So lines DC and CE are parallel, of equal length, and on a same line, in other words point C is on the line DE.
Altitudes AX and BY evenly divide DC and CE (triangles ACD and BCE are isosceles). Point F is constructed by drawing line DF length L, and drawing line EF also length L. Triangle DEF is isosceles, so has altitude CF (remember DC = CE).
When condition is met ÐBEF = 90 deg, then ÐCEF + ÐYEB = 90 deg. Also ÐYBE + ÐYEB = 90deg Þ ÐCEF = ÐYBE. FE = BE = L, so right triangles CEF and BEY are congruent!
There are 6 congruent right triangles forming total area, each with sides a and b with length ratio 1:2 (CE = 2 * YE) and hypothenuse L.
a^2 + (b)^2 = a^2 + (2a)^2 = L^2 Þ a^2 = L^2 / 5
Area of triangle = 0.5 * a * b = a^2 = L^2 / 5
Total area (of six triangles) is 6 * L^2 / 5 = 6L (total perimeter); Þ L = 5
Answer is L = 5