# $filename comes from input my $marker; $marker = readdir(DIR) while ($filename cmp $marker); print "$_: " . readdir(DIR) . "\n" for (1..10) ;