in reply to Database hash/array mapping and OO

You don't understand what my does and variable scoping and need to see Coping with Scopng. Or look at Class::DBI which does similar stuff for you.

Replies are listed 'Best First'.
Re: Re: Database hash/array mapping and OO
by inblosam (Monk) on May 15, 2004 at 13:58 UTC
    Read that, didn't help too much. Just says use my and don't use local. I tried using local anyhow and that didn't fix the 'Global' error I got. Class::DBI probably is the way to go...I figured someone had done what I was trying to do before.

      No, you need to read again and understand the scoping of lexical variables. Your my %columns delcaration is only good for the sub you declare it in. If you want it visible to both subs you need to declare it outside of them at the file scope. CwS explains this.