in reply to Need Help:Trying to assign Conditional Value to a variable

I am using this.  $loadrel{$load} .="$dept"; I am getting null as output. $loadrel is not getting set to any value..

Sorry, but that is inadequate. In your code snippet $load and $dept are never defined, so of course they are undef.

Instead of describing how you understand $dept and $load and %loadrel get defined , you need to show code that demonstrates that ( How do I post a question effectively?, Short, Self Contained, Correct (Compilable), Example)

For example

#!/usr/bin/perl -- use strict; use warnings; use Data::Dumper; my %loadrel; for my $load ( qw/ a b c /){ for my $dept ( qw/ 1 2 3 / ){ $loadrel{$load} .= " $dept "; } } print Dumper( \%loadrel ); __END__ $VAR1 = { 'c' => ' 1 2 3 ', 'a' => ' 1 2 3 ', 'b' => ' 1 2 3 ' };