in reply to Tracking down errors in data from input files.

Two things, first @array=(@array,$number); is more efficiently written as push @array, $number;. The way you wrote it the entire contents of @array are copied each time.

Second see Carp for printing the call stack. At its simplest

use Carp qw(carp); carp "data $variable not valid in mySub\n";