The 26-year-old impressed in midfield and scored United's winner with a sweet right-footed shot after just eight minutes.
Perkins was making his first start for United after returning from a five-game suspension after being sent off for Rochdale in last season's League Two play-off semi-final.
Colchester took the lead when Millwall could only clear Dean Hammond's free-kick as far as Perkins whose shot rebounded in off the crossbar.
United were dominant in the first half with Tresor Kandol looking an isolated figure up front for Millwall.
But the Lions almost equalised on the stroke of half-time when debutant Ashley Grimes was brought down on the edge of the area. Karl Moore's chipped free-kick beat Mark Cousins but cannoned back off the crossbar.
Millwall improved in the second half but rarely troubled Colchester keeper Cousins. And although they created little themselves United held firm to book their place in the second round.