in reply to Returning Hashes
For this reason there are two tools available to help protect ourselves.. because odds are you'll do this again (through no intention on your part). They are:
- never, ever give both a scalar and a hash the same name! It's possible and valid to do this but fraught with danger..!
- try using the following bit of code whenever you're not seeing what you expect (I do this all the time):
{ use Data::Dumper; print( Dumper( $dbReturn ) . "\n"; }
The second tip is what I'll recommend the most, along with pulling out the debugger. I asked my first manager in a software engineering role what his best tip for coding was - and he said "learn to use the debugger". Now that I'm a bit older I know what he meant! Anyway, enough rambling..
PS I think your question was laid out very nicely.. thanks for going to the effort to present a well structured question.
|
|---|