in reply to Re^2: Creating 'new' subroutine.
in thread Creating 'new' subroutine.

If we're guessing at intentions, then I might wager:

$options = scalar(@_) == 1 ? $_[0] : { @_ };

Though that's probably better written as:

$options = { scalar(@_) == 1 ? %{$_[0]} : @_ };

... to deliberately shallow clone in the case of a hashref.

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name