Consider a variable one-time pad, that is, $\mathcal{M}:=\{0,1\}^{\leq \ell}$ is the set of plain text. Now, this scheme is not perfectly secret, since you can take two plain text of different size, say $|m_1| = 1, |m_2| = 2$ and considering a cipher text $c$ of length 1, the next happens: $$Pr(E(k, m_1) = c) = \frac{1}{2},\ Pr(E(k, m_2) = c) = 0.$$
Thus, how can I make a construction of this variable one-time pad such that it's perfectly secret? Is it even possible?
I tried to make sub-one-time pads, i.e., $\ell$ one-time pads, but it doesn't work when you have two messages of the same length (same as above), so my other idea was to extend all messages to be length $\ell$ by adding zeros to the right. The problem though, is that if you consider $\ell = 4$, how can you decrypt the messages 1, 10, 100, 1000?