To isolate the variable scope used inside the $file it is required in i...

...t's own method - refs #8132 

@Raydiation @tanghus @icewind1991 THX