##
while($itDetail) {
(my $_line, $itDetail) = split /\015\012/, $itDetail, 2;
...
####
(my $Num, $_line) = split /\^/, $_line, 2;
my ($Qt, $_trashit) = split /\^/, $_line, 2;
$_line = ""; # Reset the variable, just for my sake.
# Do some things....
}
####
open(FH,">>/some/path/debug.txt") or die "could not open file for writing: $!";
print FH '$Num = ', $Num, "\n";
close(FH);