Just FYI, in a module "included" by use, executable statements in "file scope" are being run inside a begin block.
From the documentation for use, use Module LIST; is the same as:
BEGIN { require Module; Module->import( LIST ); }
The reason for using a BEGIN block in a module to execute some code before the module is completely compiled. Even without the BEGIN block, any "file scope" statements will get executed before anything after the use is compiled (then run).
As for the desirability of file scope code in a module, by design, Perl expects a "used" module to run init/sanity-check code at "use time". This is why most modules end with 1;. Perl is expecting the module to "return" a true value if everything is "A-Okay". Otherwise, a false value tells Perl something went wrong. Fetching the current working directory is a reasonable init action. Of course, if you are more comfortable using a BEGIN block, that's fine, too. TIMTOWTDI.