Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: use strict

by DamnDirtyApe (Curate)
on Nov 18, 2002 at 07:19 UTC ( [id://213681]=note: print w/replies, xml ) Need Help??


in reply to use strict

Not to be rude, but there's bigger problems here than what strict is reporting.

  • If you're going to use the CGI module, you might as well take advantage of the header() function, rather than manually printing it.
  • Your logic to get a string with today's date could easily be done if you'd use the POSIX module.
    my $today_str = POSIX::strftime( "%m/%d/%Y", localtime );
  • It's a little tough to deduce what you're doing in the while loop where you process the data file. Give a little though to what you're trying to accomplish there, or at least how you name your variables.
  • The two screens of print statements at the end are atrocious. It doesn't scale well, and it's a complete waste of space. At a minimum, use a loop to iterate over the people you're printing information on. for best results, make basic use of a templating system, like Template Toolkit (my fav), or HTML::Template (also popular.)

Hope you can take something useful away from that.


_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
            --Friedrich Nietzsche

Replies are listed 'Best First'.
Re: Re: use strict
by AcidHawk (Vicar) on Nov 18, 2002 at 07:28 UTC

    This is the type of answer I like to read!!!

    I meerly went about taking the immediate issue away but never even thought about making suggestions about style or proper use of modules. (Possibly need more experience in both areas...)

    Perl Monks and the perl communtiy can only benifit from clear suggestions like yours. I hope to see far more replys, when I am searching for a particular problem, like the one you entered.

    ++ DamnDirtyApe

    -----
    Of all the things I've lost in my life, its my mind I miss the most.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-19 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found