1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/usr/bin/perl use strict; use warnings; use 5.010; my %par = ( text => "Tes\x01t", zeichen => qr{[e\x01]}x, ); test(\%par); say $par{text}; sub test { my ($par) = @_; $par->{text} =~ s/$par->{zeichen}//; }
2014-04-13T10:20:28 pqregex-modifier /g vergessen?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my %par = (
text => "Tes\x01t",
zeichen => qr{ [e \x01] }x,
);
test(\%par);
say $par{text};
sub test {
my ($par) = @_;
$par->{text} =~ s/$par->{zeichen}//g;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use warnings; use 5.010; my %par = ( text => <<'TESTDATEI' Te|s\x01t Test| TESTDATEI , zeichen => qr{[|\x01]}x, ); test(\%par); say $par{text}; sub test { my ($par) = @_; $par->{text} =~ s/$par->{zeichen}//g; }