The behavior that you describe is bizarre, so it's difficult to imagine. Try reducing the code to a minimal test case so you can isolate the error. I recently had a problem where I thought my was not localizing a variable properly and I assumed that I had a bug. As it turns out, I had a typo which several other programmers missed, but reducing to a minimal test case (I was going to post it here if I could replicate it) revealed my problem.

If you're curious, here's what happened with me: At the top of my program, I had

my @data;
In one of my subs, I forgot parens around a set of variables I was declaring:
my @stuff, @data;
Guess what? I didn't localize @data (had I been more creative with my variable names, strict would have caught this). It took me quite a while to spot that. I thought I had a genuine bug in DBI uncovered.

Remember, get a minimal test case and if you still have it, post the code and we'll get to work :)

Cheers,
Ovid

On a side note: I always think I've found a problem in Perl, or DBI, or CGI, only to discover that the problem is my code. In a year of doing Perl, I've only encountered one actual bug in Perl. I'll be good money that the issue is your code.


In reply to (Ovid) Re: When is my variable not really mine? by Ovid
in thread When is my variable not really mine? by gaspodethewonderdog

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.