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
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 798
Download (untitled) / with headers
text/plain 798b
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);
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2371-1280071091-47.59689-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 741
Download (untitled) / with headers
text/plain 741b
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);


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.