7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
while ((my $a, my $b) = each %hash_1) {
while ((my $c, my $d) = each %hash_2) {
$b =~ s/$c/$d/g;
}
...
}
$b = s/\Q$c\E/$d/g;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
C:\>perl
my %hash1 = (1 ,2,3,4,5,6);
my %hash2 = (2,3,4,5,6,7);
while( my ($c,$d) = each %hash1 ){
print $c," .. ", $d,"\n";
while( my ($e,$f) = each %hash2 ){
print " $e .. $f\n";
}
}
^D
1 .. 2
6 .. 7
4 .. 5
2 .. 3
3 .. 4
6 .. 7
4 .. 5
2 .. 3
5 .. 6
6 .. 7
4 .. 5
2 .. 3
1
2
3
4
5
6
7
8
9
10
%a = (foo => 1, bar => 2);
%b = (goo => 1, dar => 2);
while ( my ($i, $j) = each %a )
{
while ( my ($x, $y) = each %a )
{
print "$i $j $x $y\n";
}
}
1
2
3
4
5
6
7
8
9
10
%a = (foo => 1, bar => 2);
%b = (goo => 1, dar => 2);
while ( my ($i, $j) = each %a )
{
while ( my ($x, $y) = each %b )
{
print "$i $j $x $y\n";
}
}
7 Einträge, 1 Seite |