Subject: | Readonly::Readonly never uses XS |
Contrary to what the documentation claims, the Readonly function never
uses Readonly::XS implementation. This patch fixes that.
- croak $MODIFY if is_sv_readonly ${$_[0]};
- my $badtype = _is_badtype (ref tied ${$_[0]});
- croak "$REASSIGN $badtype" if $badtype;
- croak "Readonly scalar must have only one value" if @_ > 2;
-
- my $tieobj = eval {tie ${$_[0]}, 'Readonly::Scalar', $_[1]};
- # Tie may have failed because user tried to tie a constant, or
we screwed up somehow.
- if ($@)
- {
- croak $MODIFY if $@ =~ /^$MODIFY at/; # Point the finger
at the user.
- die "$@\n"; # Not a modify read-only message; must
be our fault.
- }
- return $tieobj;
+ return Scalar1(${$_[0]}, @args);