#!d:\perl\bin\perl.exe -w use strict; my $dir = 'file:/IP/'; opendir (DIR, $dir) or die "cannot opendir $dir"; foreach (readdir(DIR)){ #do something }