First, to clarify, the Catechism speaks of "perfect contrition," not a "perfect act of contrition." This is an important distinction because it is not a perfect act (e.g., reciting an act of contrition prayer perfectly) that obtains the forgiveness of grave sins; it is the contrition itself that must be perfect.
Contrition is defined as "sorrow of the soul and detestation for the sin committed, together with the resolution not to sin again" (CCC 1451). Contrition may be imperfect or perfect.
Imperfect contrition, which does not obtain forgiveness of grave sins, "is born of the consideration of sin’s ugliness or the fear of eternal damnation and the other penalties threatening the sinner" (CCC 1453).
Perfect contrition, on the other hand, "arises from a love by which God is loved above all else" (CCC 1452). Only this form of contrition obtains the forgiveness of grave sins before going to confession.
Since perfect contrition obtains the forgiveness of grave sins, one who makes an act of perfect contrition may receive the Eucharist under certain conditions. The Code of Canon Law states:
A person who is conscious of grave sin is not to celebrate Mass or receive the body of the Lord without previous sacramental confession unless there is a grave reason and there is no opportunity to confess; in this case the person is to remember the obligation to make an act of perfect contrition, which includes the resolution of confessing as soon as possible. (CIC 916)
Note that there are four conditions that must be fulfilled before going to Communion:
- There must be a grave reason to receive Communion (e.g., danger of death).
- It must be physically or morally impossible to go to confession first.
- The person must already be in a state of grace through perfect contrition.
- The person must resolve to go to confession as soon as possible.