I have about ten routines that are common to a number of classes. These routines are kept in a package called Func. After profiling an application with DProf, I was surprised to find that most of the time is being spent in the BEGIN section of Func.
Here is the output from the profiler:
Total Elapsed Time = -36.6621 Seconds
User+System Time = 86.44528 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
28.4 24.62 28.883 738874 0.0000 0.0000 SE::Util::Func::BEGIN
Here is the top of the Func module:
package SE::Util::Func;
use Exporter;
@ISA = ('Exporter');
@EXPORT= qw( SE_cat SE_dump SE_getName SE_getValue SE_isTag SE_matchN
+ame SE_matchNamePattern SE_prog SE_trim );
require 5.6.1;
use strict;
Why is perl spending so much time in the BEGIN section of Func?
Thanks.