Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Gettting the last Friday of every month using Time::Piece

by Jim (Curate)
on Jul 01, 2014 at 17:47 UTC ( #1091892=note: print w/replies, xml ) Need Help??


in reply to Re: Gettting the last Friday of every month using Time::Piece
in thread Gettting the last Friday of every month using Time::Piece

++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.

This…

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
    Great thanks for the correction and improvement.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1091892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2020-09-24 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (134 votes). Check out past polls.

    Notices?