I have a snippet of code I'm working on, I'm decent with perl, but as I've always had to learn in a hurry, my all-around knowledge is lacking. What I have here is a matrix of data, and I need to change the first field in each row into undef so that I can continue with the rest of the script
sub indextime{
open FILE, "<p2cash.prn";
open OUTP, ">p2cashmast.txt";
select STDOUT;
undef (@matrix);
while (<FILE>){
push @matrix, [split];
}
$storenum = $matrix[0][0];
$date = $matrix[0][1];
#approx line 100
print "date $date \n ";
print "store$storenum \n ";
#@matrix[0] = undef;
#@matrix[1] = undef;
#@matrix[2] = undef;
#@matrix[3] = undef;
select OUTP;
for $i (6.. ($#matrix-1)){
#$matrix[i][0] = $storenum;
$matrix[i][0] = undef;
print "@{$matrix[$i]} $storenum $date\n";
}
}
I tried the
$matrix[i][0] = undef, but that didn't do it.