Hi all,
I have problem with 3-dimensional array:
push(@array,"$a,$b,$c");
Strictly speaking, this is not a 3-dimensional array but a 1-dimensional
array.
I don't know how to show only $a from first element of this array.
It depends upon the contents of $a: if $a contains commas, there is no
way you can achieve that: Imagine you effectively pushed
"1,2,3,4,5,6,7": Now was that $a=1, $b=2, $c="3,4,5,6,7" or was that
$a="1,2", $b=3, $c="4,5,6,7", ...
Anyone could who knows answer, I will be grateful.
If you can guarantee that $a does not contain commas:
print "Result=", (split(/,/, $array[0],2))[0], "\n";
If you cannot guarantee that, you might want to have a look at csv
(Text::CSV_XS).
Josef
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details:
http://www.fujitsu-siemens.com/imprint.html