$dir='C:\Windows\Desktop\Perl\scriptz\miei\opendir\1\ '; opendir(DIR, $dir) || die "no $dir?: $!"; @filez=; foreach $name (sort readdir(DIR)) { print "$name\n"; open FU, $name || die "can't read URL :$!"; my @contfile=; $url=substr($contfile[1],8,); print "$url\n"; close FU || die "$!"; }