in reply to Re^2: please explain some code
in thread please explain some code

"my $dir = @_" is scalar context, so $dir will contain number of elements in @_
"my ($dir) = @_" is list context, so $dir will contain first value of @_ (if exists)