in reply to lifetime of refs to DBI handles passed to sub as hash elements and assigned to scalar within it

I think you're fine as far as passing the ref, but there are a couple of other style points that may bite you later.

HTH

  • Comment on Re: lifetime of refs to DBI handles passed to sub as hash elements and assigned to scalar within it
  • Select or Download Code

Replies are listed 'Best First'.
Re (tilly) 2: lifetime of refs to DBI handles passed to sub as hash elements and assigned to scalar within it
by tilly (Archbishop) on Aug 31, 2001 at 01:00 UTC
    People are divided on whether or not to use &. While you are right that you can forget parentheses, you can also get bitten by naming your function with a built-in name.

    And if you don't use &, then there are arguments about using parentheses. If you don't use them and you use strict.pm, then for the cost of having to predeclare functions you get typo checking on your functions. Of course then you have to worry about precedence errors and people misunderstanding you.

    Personally I don't use & and do use parentheses. But I wouldn't say that that choice is the One True Rule that everyone should follow...