in reply to Why am I getting Can't use string (<string value>) as an ARRAY ref wile "strict refs" in use

It would be helpful if you could show a sample of the input file and the required output. Are you trying to load a file into an 2 dimension array like this perhaps ?

#!perl use strict; my $dir = 'C:/CCI/scci_clearcase/'; my $infile = $dir.'temp3_out.txt'; open IN,'<',$infile or die "Could not open $infile : $!"; # Load Metrics table # my @table = (); while (my $line = <IN>) { chomp $line; my ($dum1,$dum2) = split / /,$line,2; my ($i,$j,$k,$l) = split /,/,$dum1,4; my ($product,$date,$hour,$user) = split /,/,$dum2,4; push @table,[$i,$j,$k,$l,$product,$date,$hour,$user]; } close IN; my $outfile = $dir.'temp2_out.txt'; open OUT,'>',$outfile or die "Could not open $outfile : $!"; for my $rec (@table){ my ($i,$j,$k,$l,$product,$date,$hour,$user) = @$rec; print OUT "$i, $j, $k, $l user='$user' mtab='$product $date $hour' + \n"; } close OUT;
poj
  • Comment on Re: Why am I getting Can't use string (<string value>) as an ARRAY ref wile "strict refs" in use
  • Download Code