Bake the flaky piecrust completely or bake the crumb crust as described in the recipe. Start the filling while the crust is in the oven. Cool the crust slightly on a wire rack, but leave the oven on at 350°F.
In a small saucepan, combine the granulated sugar, cornstarch, and a pinch salt. Mix the egg yolks, milk, and vanilla seeds together in a small bowl. Stir the wet ingredients into the dry ingredients and put the pot over medium heat. At first, whisk occasionally to eliminate lumps. Then whisk almost constantly until the mixture boils and thickens enough to coat the back of a spoon, about 10 minutes. Remove from the heat, stir in the butter and the vanilla extract if you’re using it, and set aside.
Make the meringue: Beat the egg whites with a pinch salt until foamy. Keep beating, gradually adding the confectioners’ sugar, until the mixture is shiny and holds fairly stiff peaks.
Pour the filling into the crust. Cover with the meringue, making sure to spread the meringue all the way to the edges of the crust; this will keep it from shrinking. As you spread the meringue, make peaks and swirls if you like. Put the pie plate on a baking sheet to catch drips and bake for 10 to 15 minutes, until the meringue is lightly browned. Cool on a wire rack, then refrigerate for at least 2 hours. Serve cool.