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


in reply to Re: Re: Some suggestions on coding style - a chance to critique
in thread Some suggestions on coding style - a chance to critique

True. For a standalone script, it's always nice to see some globally used parameters at the top for easy customization/configuration.

I do the follwing in such cases...

If the variables are "configuration" type of variables, I would use constants, not plain scalars. I feel much better in knowing that most ( if not all ) of the globally accessible variables would be visually different from other local variables:

#!perl use constant LOG_DIRECTORY => '/foo/bar/baz'; use constant SOME_URL => 'http://baboon.com'; main(); sub main { .... some_random_function( LOG_DIRECTORY, $local_variable ); }