From c3503359723312ce7d26f102812328dce3063b7b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Tue, 30 Dec 2014 18:29:07 +0100 Subject: Declare that switch feature is used (not perl version providing it), and fully use it. --- pandoc-cs1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pandoc-cs1') diff --git a/pandoc-cs1 b/pandoc-cs1 index 27ba8d4..506565a 100755 --- a/pandoc-cs1 +++ b/pandoc-cs1 @@ -3,7 +3,7 @@ use warnings; use strict; -use v5.10.1; # use switch keyword "when" (but avoid too complex "given") +use feature qw(switch); no if $] >= 5.018, warnings => "experimental::smartmatch"; use Pandoc::Filter; @@ -21,7 +21,7 @@ pandoc_filter sub { my $self = shift; return unless ($self->name eq 'RawInline' and $self->format eq 'mediawiki'); - for ($self->content) { + given ($self->content) { when (/^{{cite\s+(\w+)\s*\|([^}]*)}}$/) { my $id = 'ref'.++$i; my @data = pairmap { $b =~ s/"/\\"/g; "$a=\"$b\"" } -- cgit v1.2.3