yitzle wrote:
sub timestamp { my $t = localtime; return \$t; }
This function stores the localtime (seconds since epoch?) in a
variable $t
No, seconds since epoch is not what localtime() returns and what's
stored in $t.
perldoc -f localtime
--
Gunnar Hjalmarsson
Email: http://www.gunnar
On 12/12/07, Henrik Nielsen <[EMAIL PROTECTED]> wrote:
> Whats with the \$t in this sub?
> sub timestamp { my $t = localtime; \$t }
>
> And what does this do?
> sub timestamp { my $t = localtime; }
The localtime function is documented in the perlfunc manpage. It's
being used here in a scalar cont
In perl, the last variable in a function is returned.
sub timestamp { my $t = localtime; \$t }
is the same as
sub timestamp { my $t = localtime; return \$t; }
This function stores the localtime (seconds since epoch?) in a
variable $t, then returns a reference to $t.
--
To unsubscribe, e-mail