$conf{rootdir}="e:/st"; <- let think it's like this :-) #### $files[$i]="e:/st/dir1/text.xt"; #### /^$conf{rootdir}(\w+\.\w+)/ <-it works fine if file is in rootdir but if it's in dir under rootdir, no good #### before: $files[$i]="e:/st/dir1/text.xt"; after: $files[$i]="dir1/text.xt";\