Perl is the best language if it’s the language that you remember well enough.
My father loves math puzzles. He told me about one he was working on, and I did a quick estimate of how complex the answer space was and told him that it would be faster to have a computer try out every answer than to be clever about solving it.
Of course he wanted me to prove that, so I had to brush off Perl or Python. For some reason, Perl felt better.