[AなりB] - B is often an unexpected or unusual thing.
blabby
Mostly used in written language and generally is not used in daily conversations.
yuzuha
My book says that this is for a strange or unexpected event.
X スイッチを入れるなり電気がついた。 O スイッチを入れると電気がついた。 O スイッチを入れるなり爆発が起きた。
However, my book says it is only used for Verb(辞書形)+なり, but I have sometimes seen cases of Verb(た形)+なり from other sources. Does anyone know which is correct?
blabby
Verb(た形)+なり is used in a different way. It implies one movement is continuing. 〜したまま。 会社を出たなり、いつまでも帰らない。He left the office and hasn't come back. 彼女を見つめたなり、しばらくの間微動だにしなかった。He stared at her and didn't move an inch for a while. You can find better translations.
Miki
that sounds like a totally different nari, so i created a new page for it: [nari2]