in reply to Re: Re: CGI Table Column Selection
in thread CGI Table Column Selection

No problem. I also just noticed that you are not using strict or warnings. Always, always, always, use strict and warnings. Just throw 'use strict' and 'use warnings' in at the top of your code.

One more thing, the most common way to pass arguments into a subroutine is my ($scalar1, $scalar2) = @_;. You used two successive shift calls and if you coninued this practice over the course of a couple of lifetimes, it could lead to a crippling repetitive stress disease. But most importantly, it just makes your code slightly more readable.

Update: Ignore my admonition about strict and warnings. I see your previous post.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff";
$nysus = $PM . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI Table Column Selection
by devslashneil (Friar) on Jul 09, 2003 at 07:34 UTC
    Heh, i do always use strict and warnings, this was some test code copied out of my actual program, i didn't put use strict and warnings in this test program because it was only created so i could cut and paste the code into perlmonks :-D

    And usually i do my ($scalar1, $scalar2) = @_; or @ARGV however i wrote this sub with 1 parameter and added a second later. I then cut and paste the sub mostly to make the second one so the bad coding practice followed through.
    I still feel this code is really messy though, just the general way i went about it _feels_ wrong i'm not sure why.

    Neil Archibald
    - /dev/IT -
      My only other suggestion is to factor out the common variables, like password and username, used to access the database, and make them global.

      But I see you are from Perth! Hehe, I have some very fond memories of Perth when I was down under back when I was in the Navy. Are the kids still into American cars from the 50s there?

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff";
      $nysus = $PM . $MCF;
      Click here if you love Perl Monks

        Hehe, Yeah i suppose kids still are into those cars, although i am kinda a kid myself being only 20, and i have the worst car ever ;D

        Neil Archibald
        - /dev/IT -