tags:

views:

23

answers:

1
#test.pl

use Getopt::Long;
Getopt::Long::Configure ("bundling");

GetOptions ( 'TestB|B|b' => \$testb ,
             'TestA|A|a' => \$testa, );

Here is my situation i may exute perl test.pl -Ba

so i use Getopt::Long::Configure ("bundling");

Because of this my program is getting slowed initally even i tryed to execute with options perl test.pl

is there any best way slove this ?

Benchmark Results :

with Getopt::Long::Configure ("bundling");

real    0m6.101s
user    0m2.040s
sys     0m0.260s

Without Getopt::Long::Configure ("bundling");

real    0m3.019s
user    0m2.020s
sys     0m0.200s
+1  A: 

While bundling obviously slows down the initial processing (since you now have to parse the argument string for a varied combination of sub-strings), you seem to incur at most 4% system time and 1% user time increase for an empty script. Compared to the cost of actually running the script, that should not be terribly significant. I admit I'm not sure about real time changes - they don't seem too correlated - could this be due to some other factors?

DVK
You are Right :-)
Tree