#!/usr/bin/perl

use strict;

my $dir="/home/pasztor/progmodpeldak";
opendir D,$dir;
my @d=grep { /^[^\.].+$/ && -r $dir."/".$_ && -f $dir."/".$_ } readdir(D);
print "|".join(",",@d)."|\n";
rewinddir D;
@d=grep { /^.+$/ && -r $dir."/".$_ && -f $dir."/".$_ } readdir(D);
closedir D;
foreach my $i (@d) { print $i."\n"; }
