I am trying to create a hash of array. Currently the array is of size 1 only.
$f1="/scratch/aime1/PerlCode/BeforeUpgrade.csv";
$f2="/scratch/aime1/PerlCode/AfterUpgrade.csv";
open(FIN, "< $f1");
while( $my_line = <FIN> )
{
chomp $my_line;
my @values = split(',', $my_line);
my $key = shift @values;
print "$key\n";
print "@values\n";
$hash1{$key} = @values;
}
close(FIN);
for (keys %hash1) {
my @value_array = $hash1{$_};
print "Key is $_ and first Element of array is $value_array[0] \n";
}
So,the key is of the form /scratch/aime1/idmUpgrade/idmUpgrade and the value is its permission i.e. 0755
When I try to print this hash,output is:
Key is /scratch/aime1/idmUpgrade/idmUpgrade and first Element of array is 1
Array is always printed as 1 and not as 0755.