in reply to "use strict;" woes

our $serverDB = "blahblahblah"; . . . our $db = "DBI:mysql:$serverDb:$serverName";

You didn't capitalize the last 'b' in $serverDb.

BTW--Generally, globals are capitalized to make it clear that they are, in fact, globals. Words are seperated with '_' chars, so your $serverName would become $SERVER_NAME. This idiom would have saved you above.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: "use strict;" woes
by Anonymous Monk on Oct 14, 2003 at 18:06 UTC
    BTW--Generally, globals are capitalized to make it clear that they are, in fact, globals. Words are seperated with '_' chars, so your $serverName would become $SERVER_NAME. This idiom would have saved you above.
    I think you are generalizing your personal stylistic preference to a community preference, which it most assuredly is not.

      If I'm guilty of it, then so is Larry Wall (yes, perlstyle specifically addresses this point).

      ----
      I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
      -- Schemer

      Note: All code is untested, unless otherwise stated

        • You didn't say: Larry's preference, you said "generally"
        • Larry does not explicitly address that in perlstyle. (note, LW's style notes are only the first portion of that doc, the latter portion is other's (largely Tom Christiansen).
        • One part of that document *does* explicitly address using case to indicate scope, and it suggests all caps for *constants*, and mixed case for package globals (the case at hand).
        • As many people in the community use MixedCase as use underscores to separate "words" in identifiers.
        Your way is in no way the general way, or even the recommended perlstyle way.
      My experience is that if you look at a lot of CPAN code you will find that underscores are more popular than studly caps, package globals are usually Mixed_Case, and constants are usually ALL_CAPS. This is backed up by most of the writings on Perl style. You are of course free to do whatever you like in your code, but I don't think it's a stretch to call this a general preference.
        My experience is that if you look at a lot of code whether on CPAN or elsewhere you'll find all sorts of different styles. I couldn't care less whether someone uses variables_like_this or variablesLikeThis, they're both equally readable to me and equally functional. What I do care about is the style police telling me what I should and should not do. Thankfully, perl itself ignores the style police, so I can too.