- find a representation for your m×n rectangle.
e.g. my @rect=[ (1) x $m ] x $n;
- find a representation for your L-shapes
- code some functions to turn or flip your shapes
- code a function that will put one L-shape in every possible orientation into each possible location of your rectangle
- after each time putting it in, the function should call itself in order to put another L in
- if all possiblities are tried, the function has to return
That's just one stupid strategy I can think of. With this I solved a puzzle many years ago in LOGO on my C64. I couldn't sleep that night because each time a solution was found, the printer made a loud noise printing it ;-)