The EPIC debugger uses the PadWalker module to show local (or lexical) variables. PadWalker 0.10 does not display the values for lexical variables declared on top-level (outside of functions and blocks) correctly if used in debugger mode. To get around this problem, put your code within a function:
dummy();
sub dummy
{
<YOUR CODE>
}