We study $B\ensuremath{\rightarrow}\ensuremath{\pi}\ensuremath{\pi}$ decay with a modified perturbative QCD approach. The branching ratios and $CP$ violation are calculated with the transverse momenta of partons considered. Sudakov factor associated with each meson is included to suppress soft contribution in QCD. With the wave function of $B$ meson obtained in QCD-inspired relativistic potential model being used, the suppression of Sudakov factor to the soft contribution is not effective enough. Soft scale cutoff and soft form factors of $B\ensuremath{\pi}$ transition and $\ensuremath{\pi}\ensuremath{\pi}$ production have to be introduced. The main next-to-leading-order contributions of vertex correction, the quark-loop, and magnetic penguin are included. To solve the long-standing puzzle in $B\ensuremath{\rightarrow}\ensuremath{\pi}\ensuremath{\pi}$ decay, that is the theoretical prediction of the branching ratio of ${B}^{0}\ensuremath{\rightarrow}{\ensuremath{\pi}}^{0}{\ensuremath{\pi}}^{0}$ being seriously smaller than experimental data, color-octet matrix element which is of long-distance dynamics is introduced. With parameters taken with reasonable values, all the branching ratios and $CP$ violation are well consistent with experimental data.