[Bug] Comparison between two PeriodIndexes doesn't validate length (GH #23078)
- [x] closes #23078
- [x] tests added
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
