in reply to Re: Sharing a variable between (>=) 2 files
in thread Sharing a variable between (>=) 2 files

Omg, you're right, that solved it. I feel a bit ashamed now - especially since that was my first question here.

For future reference: using 'our' works, only problem with the code was that I was too stupid to use an assoc array in Perl. :(

Thanks a lot!



Btw: Do I now have a reputation of -1 because my question sucked or simply because I asked 1 question and answered 0 so far (and 0 - 1 = -1)?
  • Comment on Re^2: Sharing a variable between (>=) 2 files

Replies are listed 'Best First'.
Re^3: Sharing a variable between (>=) 2 files
by Joost (Canon) on Nov 30, 2007 at 23:08 UTC
    The "real" problem is, that using 'strict' and 'warnings' does not influence require()d files, so references to unused variables in your require()d file don't give warnings or errors.

    Btw: Do I now have a reputation of -1 because my question sucked or simply because I asked 1 question and answered 0 so far (and 0 - 1 = -1)?
    If you mean, why has your post a rep of -1, it probably means 1 of the "regulars" downvoted your post for some reason and none of them bothered to upvote it.

    Don't worry too much about it unless you get below -5 or so. Large (positive or negative) XP values indicate a sort of consensus. Small XP values change a lot.

      The "real" problem is, that using 'strict' and 'warnings' does not influence require()d files, so references to unused variables in your require()d file don't give warnings or errors

      True. I played around a bit with the code yesterday and also noticed that. When I added 'use strict' to settings.pl, I got a bunch of warnings with the old (wrong) code.
Re^3: Sharing a variable between (>=) 2 files
by Argel (Prior) on Dec 01, 2007 at 00:10 UTC
    Btw: Do I now have a reputation of -1 because my question sucked or simply because I asked 1 question and answered 0 so far (and 0 - 1 = -1)?

    Your node has a reputation. Users get levels which are based on how many experience points they have (like in Dungeons & Dragons and several other role-playing games that followed its lead).

    Don't beat yourself up too much -- to the person that wrote the code it looks correct so the bug gets glossed over. It is almost a prerequisite that a second pair of eyes is needed to catch this kind of bug.