abubacker has asked for the wisdom of the Perl Monks concerning the following question:
I have a snippet like this
I just wanted to include the Time::HiRes module with a timeBEGIN { require "call_simulator.pm" ; use constant { START => 1000 , NO_OF_CALLS => 1 , DEBUG => 1 , DET_DEBUG => 1 , TOTAL_TIME => 1 , DETAILED_TIME => 1 , RESPONSE => 1 , SLEEP => undef , MICRO_SEC => 1 , }; # This works well if ( MICRO_SEC ) { eval "use Time::HiRes qw (time )" ; } # This works # use if ( MICRO_SEC ) , "Time::HiRes" ; # This won't work # use if ( MICRO_SEC ) , "Time::HiRes qw(time)" ; # ERROR : # Can't locate Time/HiRes qw(time).pm in @INC (@INC contains: /etc/ +perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib +/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/ +local/lib/site_perl .) at /usr/share/perl/5.10/if.pm line 13. }
|
|---|