my $s=q|Tom.Dog.Ben.Cat|; my @array; for (split /\./,$s){ push @array,[$_] } # Created a 2-d array containing: # [0][0]=Tom # [1][0]=Dog # [2][0]=Ben # [3][0]=Cat print qq| $array[2][0];\n|; # Prints "Ben;"
Syntactic sugar causes cancer of the semicolon. --Alan Perlis
In reply to Re: splitting data into multiple arrays?
by NetWallah
in thread splitting data into multiple arrays?
by derpp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |