in reply to Passing the files as an argument in Subroutines

this is your first mistake :)
#use strict; #use warning;