Possibility of perfect virtual reality Is it biologically possible to build a "perfect" virtual reality, in which the person in that world cannot distinguish it from the real world? (e.g. as in the movie The Matrix)

From my knowledge (which is very limited), we perceive everything as a result of electrical activity within nerves. If we were able to encode/decode the patterns of the electrical activity and understand how the brain communicates with and intercepts all the nerves between the brain and the other parts of the body, would this mean that a perfect virtual reality is possible?
If you look at the phenomenon of lucid dreaming, where people consciously explore their dreams, you will recognize that perfect virtual reality is possible with the biology that is already in place.

The lucid dreaming related phenomenon called "false awakening" is another piece of evidence for perfect virtual reality. When a lucid dreamer experiences a false awakening, it is indistinguishable from reality. A person  wakes up in the same bed. walks through replica rooms. Such person may use restroom, brush teeth, start making breakfast, then wake up in reality. The only two consistent differences between a false awakening and reality would be inability to see consistent time on a digital display and inability to adjust light levels with light switches. The defining characteristic of false awakenings is that they trick the dreamer into thinking the dreamer is interacting with reality.

I should probably mention that expert dreamers, those who keep a dream journal and train to remember dreams, experience their dreams more intensely. As such, it is not uncommon to hear of "hyper-real" dreams, which are more visually and cognitively clear than baseline reality.