Hi,
[...]
Why donīt use $dbh as a global? Now in this way it works for me at this time!
In general using globals in this way is considered bad form. It is considered bad form because as the number of lines, modules, etc. grows in the program it becomes harder and harder to remember what all has been used, what has been set, etc. Mostly it destroys encapsulation, which helps with debugging, testing, and backwards compatibility when it is time to refactor the code. I won't go so far as to say never to use a global, or in Perl's case a package variable, as there are very good reasons to, this just isn't one of them :-). Your subs should be passed all information they need to have, and return all that they need to (aka avoid side effects (setting globals from within subs)), which is rather vague, but until you know when to break this you shouldn't.
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]