I don't think it works. Line is infinite, whereas you used line segments. In my thinking above lines create 8 square.
I agree though, Pickett's answer appears to give 8 squares.
Ahh, didn't realize the OP meant infinite lines, not line segments...that definitely makes the puzzle more fun/interesting