It doesn't need to be perfect, you're opening the line anyway and you need to bleed it on completion of the refurb.
Best for you, and easiest, is to get a piece of rubber hose and push it over the end of the brake hose when you remove it from the caliper, fold or blank the end of that just to stop all fluid loss.
Remember to pump your caliper pistons out to the max before you break the lines so as to ease their removal!