There is also a perfect (or past) form of gerunds. The past form of gerunds is formed by using having + past participle. This kind of gerund suggests that the gerund happened before something else.
NO GERUND I have been to South Korea.
WITH GERUND My having been to South Korea helped me learn the language when I took classes.
*this suggests that the speaker had gone to South Korea BEFORE he took the language classes
This rule works not only for the present perfect, but also for other past tense forms. Look at the following sentences. The first one (without the gerund) uses the simple past tense (took).
NO GERUND I took a physics class.
WITH GERUND Having taken a physics class helped me in calculus.