9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
use strict;
my $b = "abcdefghiklcafkasgf";
my $html = "abc";
# while ($b =~ s/$html/cdef/) {
# }
# kann durch g schalter ersetzt werden
$b =~ s/$html/cdef/g;
print $b;
1
2
3
4
5
6
#!/usr/bin/perl -w
$b="abcdefghijklmnopqrstuvwxyz";
$html="abc";
$b=~s/$html/cdef/g;
print $b;
1
2
3
4
5
6
7
8
9
10
11
12
C:\Daten\perl>cat nostrict1.pl
$b = abcdefghiklcafkasgf;
print "b = $b\n";
$html = abc;
$b =~ s/$html/cdef/g;
print $b;
sub abcdefghiklcafkasgf { blaubart }
C:\Daten\perl>nostrict1.pl
b = abcdefghiklcafkasgf
cdefdefghiklcafkasgf
1
2
3
4
5
6
7
8
9
10
11
12
C:\Daten\perl>cat nostrict2.pl
sub abcdefghiklcafkasgf { blaubart }
$b = abcdefghiklcafkasgf;
print "b = $b\n";
$html = abc;
$b =~ s/$html/cdef/g;
print $b;
C:\Daten\perl>nostrict2.pl
b = blaubart
blaubart
9 Einträge, 1 Seite |