Thread Arrays (5 answers)
Opened by blaise4714 at 2007-04-19 17:03

Ronnie
 2007-04-19 17:32
#76059 #76059
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
oder mit map:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl

use strict;
use warnings;

use Data::Dumper;

my @test1 = ("1","2","3","0","0","0","0","t","5","8","0","0","56");
my @test2 = ("0","0","0","z","i","p","y","u","9","9","8","9","10","58");

@test1 = map { $test1[$_] eq '0' ? $test2[$_] : $test1[$_] } 0 .. $#test1;
print Dumper \@test1;

View full thread Arrays