And ChatGPT shouldn't be capable to port a piece of foreign code to Perl.
edit: fixed a few typos and added a couple of missing words that apparently formed in my head but my hands never got the message to actually type them in.
I can't test right now with a "pure" example because ChatGPT is overloaded.
Since ChatGPT basically generates new text based on text already given to it in the conversation, it could do a good job at attempting to port foreign code to Perl. I doubt it would get it perfectly right, but even if all it did was to change the way constructs and variables are written (prefix-stuff, foreach loops and such), that could still potentially make the job go a lot quicker.