in reply to please explain some code

'&' is a deprecated (or just old-fashioned) form of calling a subroutine.

$dir is surrounded by () to force list context. Read about scalar and list context in perldata or google for 'perl context'

Replies are listed 'Best First'.
Re^2: please explain some code
by ikegami (Patriarch) on Jul 18, 2011 at 17:24 UTC
    It's not deprecated and it has a purpose. As previously stated, it causes the prototype of the sub to be ignored.
Re^2: please explain some code
by mahis_431 (Novice) on Jul 19, 2011 at 08:43 UTC
    It is also useful in cases where you are using in built perl keywords for your subroutine names:

    sort(); #wrong as sort is inbuilt keyword

    &sort(); #correct..ignores sort as keyword