use strict; use warnings; my $foo = '1Z1'; $ENV{Z1Z1} = '3,2,1'; for (1..5) { my $x = '?'; if ($ENV{'Z' . uc $foo}) { ($x, $ENV{'Z' . uc $foo}) = split /,/, $ENV{'Z' . uc $foo}, 2; } print $x, $/; } #### 3 2 Use of uninitialized value in list assignment at ./a.pl line 13. 1 ? ?