in reply to (Ovid - try eval)Re: Only
in thread Only
Without the BEGIN, the binding of time to the correct function would not happen:BEGIN { eval { require Time::HiRes; import Time::HiRes qw(time) }; if($@) { warn "Unable to import Time::HiRes\n" }; }
Would produce f.exs: 976556706. Whileeval { require Time::HiRes; import Time::HiRes qw(time) }; print time()
Would produce the correct time using the Time::HiRes::time function: 976556789.394509.BEGIN { eval { require Time::HiRes; import Time::HiRes qw(time) }; } print time()
Autark.
|
|---|