Re: `$#array` vs `scalar @array`

2018-01-29 Thread Chas. Owens
Luckily in these cases, the faster answer is also the clearest answer in either case. On Mon, Jan 29, 2018 at 5:32 PM Paul Johnson wrote: > On Sun, Jan 28, 2018 at 10:57:25PM +, Chas. Owens wrote: > > $#array is the index of the last element of @array, so it will be one > less > > than scala

Re: `$#array` vs `scalar @array`

2018-01-29 Thread Paul Johnson
On Sun, Jan 28, 2018 at 10:57:25PM +, Chas. Owens wrote: > $#array is the index of the last element of @array, so it will be one less > than scalar @array which is the number of elements in @array (since Perl > arrays start with index 0). Therefore, to get the number of elements, you > would ne

Re: What is time, anyway?

2018-01-29 Thread SurfShop
> On Jan 29, 2018, at 12:18 PM, Octavian Rasnita wrote: > > from: perldoc -f time > > timeReturns the number of non-leap seconds since whatever time the > system considers to be the epoch, suitable for feeding to > "gmtime" and "localtime". On most systems the epoch is

Re: What is time, anyway?

2018-01-29 Thread Andy Bach
YOu might look at localtime() perldoc.perl.org/functions/localtime.html or gmtime perldoc.perl.org/functions/gmtime.html time() returns the epoch time - seconds since Jan 1, 1970 UTC (IIRC), localtime transforms it to just that. So all your time() stamps will be the same and localtime() can turn

Re: What is time, anyway?

2018-01-29 Thread Octavian Rasnita
from: perldoc -f time timeReturns the number of non-leap seconds since whatever time the system considers to be the epoch, suitable for feeding to "gmtime" and "localtime". On most systems the epoch is 00:00:00 UTC, January 1, 1970; a prominent exception be

What is time, anyway?

2018-01-29 Thread SurfShop
Basic time question here. Looking at sites such as http://perldoc.perl.org/functions/time.html, I'm not seeing what the time() function is based on. Does it return the time of the server, or UTC? Is it affected by any timezone setting on the server or in a script? I tested