my $data_file = "/root/bin/load.data2";
open(FILE,"<$data_file"
or die "Cant open $data_file2: $!\n";
my @log = <FILE>;
close(FILE);
my $last_element='"0"';
while (<>){
chomp;
@log = split ',';
print "$_, $last_element\n";
$last_element = $log[$#log];
}
just need a little help with this, not sure if my code is going in the right direction.
thanks.
Nat
open(FILE,"<$data_file"
my @log = <FILE>;
close(FILE);
my $last_element='"0"';
while (<>){
chomp;
@log = split ',';
print "$_, $last_element\n";
$last_element = $log[$#log];
}
just need a little help with this, not sure if my code is going in the right direction.
thanks.
Nat