use MyModule; MyModule->save_dir('/siteX/some/dir'); #### # class data and class method accessors { my $ERROR = ''; my $POST_DIR = ''; sub error { my $self = shift; my $class = ref($self) || $self; # get class of object if called as instance method if (@_) { $ERROR = $class . ' error: ' . shift; } return $ERROR; } sub post_dir { my $self = shift; $POST_DIR = shift if @_; return $POST_DIR; } }