Thread map + readdir (18 answers)
Opened by roooot at 2009-04-15 22:34

guest wer
 2009-04-15 23:09
#120614 #120614
Code (perl): (dl )
1
2
3
opendir(my $LOGDIR, "./+logs/~$uid") or die "$!";
my @logs = map {!/^\./xms ? $_ : "" } readdir($LOGDIR);
closedir($LOGDIR);

oder willst du eher sowas?:
Code (perl): (dl )
1
2
3
opendir(my $LOGDIR, "./+logs/~$uid") or die "$!";
my @logs = grep { !/^\./xms } readdir($LOGDIR);
closedir($LOGDIR);

View full thread map + readdir