
yapp
User
Feb 24, 2002, 6:01 AM
Views: 3738
|
|
Re: [RedRum] Perl code (SSI) to detect day and time
|
|
|
Hmm using constants for that isn't really needed though :) Yep, you could use scalars aswell here or even real values. However, I normally find the last version most confusing. Saying if(WEDNESDAY < $X) is better then if(3 < $X) isn't it? At least you know where the 3 stands for (although replacing $X by $day might give you a hint ) About that constant, I never knew that. However, it might improve readability for beginners. Saying sub WEDNESDAY(){3} isn't that clear. use constant is. It's your choice off course. However, my constants.pl file i've been using in my forum scripts also uses the sub(){} notation you preffer. Creating 400 inline subroutines is quite faster then processing 400 imports that generate 400 inline subroutines. Yet Another Perl Programmer _________________________________ ~~> [url=http://www.codingdomain.com]www.codingdomain.com <~~ More then 3500 X-Forum [url=http://www.codingdomain.com/cgi-perl/downloads/x-forum]Downloads!
(This post was edited by yapp on Feb 24, 2002, 6:03 AM)
|