in reply to Re: The day of today
in thread The day of today
This example confuses the issue. One might conclude that the + (plus) is necessary, when in fact it's not. It's only there to workaround print's brain-damage. It could be written less ambiguously as:
my $dayOfMonth = (localtime)[3]; print "Today is day $dayOfMonth.";
Note to gtrain: this is technically known as an array slice. You are taking the array of values returned by localtime and slicing out only the fourth (offset 3) element).
• another intruder with the mooring in the heart of the Perl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: The day of today
by rir (Vicar) on Mar 07, 2008 at 15:01 UTC |