On Dec 24, Eric said:
>perl -e 'opendir(T,"."); $a = scalar(readdir(T)); print "$a\n";'
>..
>
>perl -e 'opendir(T,"."); @b = readdir(T) ; $a = scalar(@b); print "$a\n";'
>22
readdir() is documented to behave this way. In scalar context, it returns
the next entry in the directory; in list contex
Jsut wondering, been working with perl for about 1.5 years now off and
on. I've got most things locked down, but this ones a bit wierd. Why
would:
perl -e 'opendir(T,"."); $a = scalar(readdir(T)); print "$a\n";'
give :
..
You would think it would give some number like:
perl -e 'opendir(T,".")