File: Switch.pm-vs-Filter.pm.patch

package info (click to toggle)
libswitch-perl 2.17-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 172 kB
  • ctags: 38
  • sloc: perl: 443; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Origin: http://svnweb.freebsd.org/ports/head/lang/p5-Switch/files/patch-Switch.pm
Author: Anton Berezin <tobez@freebsd.org>
Bug-Debian: http://bugs.debian.org/762598
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=96753

--- a/Switch.pm	2014-08-01 14:47:54.000000000 +0200
+++ b/Switch.pm	2014-08-01 14:47:57.000000000 +0200
@@ -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 ) )