in reply to Set attribute on a module

The first method you mentioned is the canonical one. However, if you must do it on import, I would organize it as so:
package My::Singleton; my $object = bless {}, __PACKAGE__; sub import { shift; my %args = @_; $object->$_( $args{$_} ) for keys %args; return; } sub new { return $object } # Your methods here

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?