Leser: 7
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
my $foo = q!key2="val1","val2","val3"!;
my $bar = () = $foo =~ m/"/g;
print "$bar\n";
my $bar = $foo =~ tr/"/"/;
my $bar = $foo =~ tr/"//;
my $bar = $foo =~ tr/"/"/;
my $bar = $foo =~ tr/"//;
1
2
3
4
5
6
7
C:\Dokumente und Einstellungen\Renee>perl
my $string = "hallo'hallo'hallo";
my $var = $string =~ tr/'//;
print $string," - ",$var;
^D
hallo'hallo'hallo - 2
QuoteIf the REPLACEMENTLIST is empty, the SEARCHLIST is replicated. This latter is useful for counting characters in a class or for squashing character sequences in a class.
1
2
3
4
5
6
7
C:\Dokumente und Einstellungen\Renee>perl
my $string = "hallo'hallo'hallo";
my $var = $string =~ tr/'//;
print $string," - ",$var;
^D
hallo'hallo'hallo - 2
|< 1 2 >| | 11 Einträge, 2 Seiten |