Commented out code reduces readability and lowers the code confidence for other developers.
`break` is not strictly necessary here and could be removed.
The assignment to `$len` is dead and can be removed.
The assignment to `$substring` is dead and can be removed.