|< 1 2 3 >| | 25 Einträge, 3 Seiten |
1
2
3
4
5
6
7
foreach $part (@altes_array) {
$part =~ /\n/
? do {
(push @neues_array, $_) foreach (split /\n/, $part)
}
: (push @neues_array, $part);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use warnings;
my @array = ("hallo", "du", "bist ja\n immer noch", "da");
print "'$_'\n" for @array;
my $i = $#array;
while ($i>=0) {
my $count = $array[$i] =~ y/\n//;
splice @array, $i, 1, split /\n/, $array[$i] if $count;
--$i;
}
print "'$_'\n" for @array;
1
2
3
4
foreach (0 .. $#array) {
my @count = split /\n/, $array[$_];
$#count >= 0 && splice @array, $_, 1, @count;
}
1
2
3
4
5
6
7
foreach $part (@altes_array) {
$part =~ /\n/
? do {
(push @neues_array, $_) foreach (split /\n/, $part)
}
: (push @neues_array, $part);
}
1
2
3
4
5
6
7
foreach $part (@altes_array) {
$part =~ /\n/
? do {
(push @neues_array, $_) foreach (split /\n/, $part)
}
: (push @neues_array, $part);
}
|< 1 2 3 >| | 25 Einträge, 3 Seiten |