$dbi = new ... $mod = new MyModule(); $mod->a_method( $dbi ); .... package MyModule # different file I assume sub a_method { my( $self, $dbi ) = @_; $dbi->quote( ... ); } ...
Granted there are a lot better styles. Depending on how many methods need a database handle, passing it to each method may not be the best practice.
-derby
In reply to Re: Help with modules!
by derby
in thread Help with modules!
by denex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |