Okay, well first, what part of each line of $file is 'x,y,z,b' supposed to be?
(@x,@y)=split( ,$data);
indicates you're trying to split it at spaces. But there are 9 spaces in each line and you're only capturing the first two splitsand
@x,@y
is going to be over-written in each 'foreach'.
Then with
#
print "@x[0]\n";
#
print "@y[0]\n"; there are no file handles to printto so those will print to the command screen, assuming it's open - which it probably isn't since you're creating a html page later on.
Try
my $count = 0;
my @x = ();
my @y = ();
my @z = ();
my @b = ();
foreach my $data (@lines) {
($a_0,$a_1,$a_2,$a_3,$a_4,$a_5,$a_6,$a_7,$a_8)=split( ,$data);
$x[$count] = $a_0;
$y[$count] = $a_1;
$z[$count] = $a_2;
$b[$count] = $a_3;
$count++;
}
Once you know how things are splitting up and how you need to recombine them, then you can concatenate or join the $a_0s and $a_1s or whatever into your 4 arrays. You also want to 'use strict' - it's good form.