in reply to Difference of localtime
or, for a nix-ish OS...
perl -e 'my $now = localtime time; print "It is now $now"; my $re= scalar localtime; print "It is now $re";'Go ahead. Try it. In fact, you can often answer your own questions, by such trials.
Or did you mean to ask a question that's not evident, such as "Does using scalar make a difference in the output? (Answer: not here) or "Does changing the variable's name make a difference?" (Answer: $now is certainly easier to understand than $re) or "Will one be quicker than the other?" (Answer: Benchmark it.)
And please, you've been here long enough to know that code -- even snippets like these -- should be wrapped in <c>...</c> tags.
Update: Fixed missing </p> tag; clarified phrasing of first question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Difference of localtime
by Anonymous Monk on Feb 24, 2009 at 08:34 UTC |