http://www.perlmonks.org?node_id=1052273


in reply to count file in directory

If you follow hdb's advice you will see that you have two files and two entries called '.' and '..' which are links to the current and parent directories respectively. All directories contain those two entries so you will always see two more items than you might expect.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: count file in directory
by joaase (Initiate) on Sep 04, 2013 at 10:48 UTC
    Thank JohnGG. That explain why i see 4 count insted of 2. /Joakim