CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...: Re: [RedRum] Perl code (SSI) to detect day and time: Edit Log



yapp
User

Feb 24, 2002, 6:01 AM


Views: 5508
Re: [RedRum] Perl code (SSI) to detect day and time


In Reply To
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 Wink)


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


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

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! Cool

(This post was edited by yapp on Feb 24, 2002, 6:03 AM)


Edit Log:
Post edited by yapp (User) on Feb 24, 2002, 6:02 AM
Post edited by yapp (User) on Feb 24, 2002, 6:03 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives