++gurpreetsingh13. By your use of meaningful variable names and explanatory comments, your script explains what it does and how it does it. One is able to understand your algorithm by reading just the script itself, without having to refer to any module documentation.
my $daysToMoveBack = 0; $weekDay >= 6 ? ( $daysToMoveBack = $weekDay - 6 ) : ( $daysToMove +Back = $weekDay + 1 );
…is more succinctly written like this…
my $daysToMoveBack = $weekDay >= 6 ? $weekDay - 6 : $weekDay + 1;
|Replies are listed 'Best First'.|
Re^3: Gettting the last Friday of every month using Time::Piece
by gurpreetsingh13 (Scribe) on Jul 02, 2014 at 03:28 UTC