in reply to choosing and/or overriding defaults for a sub argument

Is the $file being passed in a filename or a reference ? If it is just a filename, then "set file to the value of $self->{file} already bound." won't work since the value doesn't get back to the caller.

Maybe what you want is for the call in the program to obj->file("Filename"); to store the filename internally, and my $fn = obj->file(); to return it.

If so, your code needs to look more like :

sub filename { my ($self, $file) = @_; $self->{file} = $file if $file; return $self->{file}; }
to get the file back to the caller.

I don't like the $self->{'file'} = shift || $self->{'file'}; idea, since setting something to itself when you don't need to is less clear.
--
Brovnik