Skip Menu |

This queue is for tickets about the Switch CPAN distribution.

Report information
The Basics
Id: 96736
Status: new
Priority: 0/
Queue: Switch

Owner: Nobody in particular
Requestors: tcallawa [...]

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)


Subject: Switch is not compatible with Filter 1.50
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
Message-ID: <rt-4.0.18-22114-1403789866-891.0-0-0 [...]>
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1403789866-22114-2"
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
Content-Length: 526
Download (untitled) / with headers
text/plain 526b
Fedora recently updated to Filter 1.50, which broke Switch functionality. Specifically, Filter made this change * Do not re-bless already blessed filter_add arguments into the callers package. Fixes RT #54452 Unfortunately, in Switch, that means that the import arguments are being treated as blessed, when they're not, and since Filter isn't re-blessing them anymore, things stop working. The fix seems straightforward, bless the args through $self and use $self at the filter_add call. The attached patch does that.
Subject: Switch-2.17-Filter-1.50.patch
MIME-Version: 1.0
Content-Type: text/x-patch; name="Switch-2.17-Filter-1.50.patch"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="Switch-2.17-Filter-1.50.patch"
Content-Transfer-Encoding: binary
Content-Length: 563
diff -up Switch-2.17/ Switch-2.17/ --- Switch-2.17/ 2014-06-10 13:03:40.395988520 -0400 +++ Switch-2.17/ 2014-06-10 13:04:50.909488953 -0400 @@ -25,9 +25,11 @@ my ($Perl5, $Perl6) = (0,0); sub import { + my ($class) = @_; + my $self = bless {}, $class; $fallthrough = grep /\bfallthrough\b/, @_; $offset = (caller)[2]+1; - filter_add({}) unless @_>1 && $_[1] eq 'noimport'; + filter_add($self) unless @_>1 && $_[1] eq 'noimport'; my $pkg = caller; no strict 'refs'; for ( qw( on_defined on_exists ) )

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

Please report any issues with to