in reply to Where does time come from? CORE::GLOBAL:time no honored.
Why does "x time()" have such a different value than "x $time"?
Because 25 seconds went by between the assignment to $time and the second call to time()?
I have no problem overridding time().
$ cat time.pl use strict; use warnings; BEGIN { no warnings qw(redefine); *CORE::GLOBAL::time = sub { 4 }; } my $time = time(); 1; $ perl -d time.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(time.pl:10): my $time = time(); DB<1> n main::(time.pl:12): 1; DB<1> x $time 0 4 DB<2> x time() 0 4 DB<3> q
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Where does time come from? CORE::GLOBAL:time no honored.
by Anonymous Monk on Mar 26, 2009 at 22:35 UTC | |
by ikegami (Patriarch) on Mar 26, 2009 at 23:05 UTC | |
by Anonymous Monk on Mar 27, 2009 at 03:27 UTC | |
by ikegami (Patriarch) on Mar 27, 2009 at 04:14 UTC |