Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Readonly CPAN distribution.

Report information
The Basics
Id: 59689
Status: new
Priority: 0/
Queue: Readonly

People
Owner: Nobody in particular
Requestors: LEONT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.02
  • 1.03
Fixed in: (no value)



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);
Screwd up that patch, here's another try - 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; + my ($ref, $arg) = @_; + return Scalar1(${$ref}, $arg);