如果实际要用,直接用find做不是更简单?find . -name "*.wav" -print > output.txt当然你要是打算练习perl实现方法就另说了。
while(<*.wav>){ print "./data/dr1/fdac1/$_";}