Yes, how did you install perl?
How did you install kde5?
Did you build from ports or use packages?
However you installed I suspect you need to update your repository to get the newer version of perl (currently 5.36 is the default.)
But depending on how you've done things will determine your best path forward.
If you are a new user (well most users these days) it's recommended that you use binary packages.
So the first step will be to sort out your system with binary packages, update those, then try and install LibreOffice (probably a better choice these days than OpenOffice).
Looking on an older system I got perl 5.34.1 around August, 5.34.3 December (on that system).
I wonder if you installed perl/kde5 using packages and so you've got perl 5.34.3 from that.
Then trying to install libreoffice from an older ports repository on your machine - and because it is older it expects perl 5.34.1.
Something like that.
Anyway, rewind slightly - are you choosing to use packages (recommended) or ports? It's not advisable to mix.