I don't see cpan being mentioned anywhere in the OP. I suppose he's talking about accessing the regular shell's command history. Without more details it's hard to tell what the problem is, though. As ^[[A is the normal escape sequence generated by many terminals for the up key, it's probably a misconfiguration of the shell that's causing the problem.