In general the answer is going to depend on some combination of your window manager and/or the desktop you're using. For KDE there's probably some sort of dcop incantation you can send to it, but without a bit more details you may not get anything more specific.
And the language is Perl, the implementation is perl; "PERL" is just wrong.
Update: Actually after thinking over it there may be some sort of window manager hints you can send, but I can't recall what you'd want to search on to track information about them down. It'd also be fairly low-level X11 calls so it wouldn't be really easy to do from perl either.
Update 2: Yeah, that wmctl below implements the thing I was thinking about. Running that through system is going to be your best bet.