how can rebuild perl
A installation manual should be part of the Perl source code.
I guess it's like all *nix software with "./configure && make && make install". Just change the prefix to /opt/lampp
with xampp,
The configure which is used by xampp you can find somewhere in (imho) share/xampp in a tar.gz.
Installing the XAMPP devel package maybe also necessary.
How to find all XS modules (like for mod_perl) and rebuild them, I don't know at the moment. I guess it's easier to delete the current Perl and start from scratch.
Maybe Kai (Oswald) knows the best way (ask him). (or can build XAMPP/Perl next time with threads support).