Now you can use $path everywhere.
The BEGIN block is done at compiletime. The rest is done at runtime. Perl compiles your script and runs the compiled then.
Read perldoc perlmod.
Boris
Comment on Re^3: finding the path of the script running as Win service