Thread mehrdimensionale Arrays: Elemente hinzufügen (16 answers)
Opened by peggy at 2004-08-09 14:19

Crian
 2004-08-09 14:28
#85607 #85607
User since
2003-08-04
5873 Artikel
ModeratorIn
[Homepage]
user image
http://wiki.perl-community.de/bin/view/Wissensbasis/AoA

Code: (dl )
1
2
3
4
5
6
my @array1 = ("Ganze Sätze", "sollen an Leerstellen", "aufgespalten werden");
my @array2;
push @array2, [ split / /, $_ ] for @array1;

use Data::Dumper;
print Dumper \@array2;


Ausgabe:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$VAR1 = [
         [
           'Ganze',
           'Sätze'
         ],
         [
           'sollen',
           'an',
           'Leerstellen'
         ],
         [
           'aufgespalten',
           'werden'
         ]
       ];
\n\n

<!--EDIT|Crian|1092047786-->
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread mehrdimensionale Arrays: Elemente hinzufügen