##
while ($line = ) {
####
sub parseDown {
my $filename = shift @_; # or $_[0] or just plain shift
# rest of sub
}
####
if (my ($tmp_dir, $file) = $line =~ m%(.*)\\(.*)% ) {
# do the rest of the stuff
} else {
warn "$line has incorrect format!\n";
}