############################## script ############################## use strict; use MyTest; my $stm = "create table TEST (N01 varchar(100)not null, N02 integer not null)"; my $objref = MyTest->old(); $objref->just_do_it(argument => $stm); ################################# module ################################# package MyTest; use strict; use DBI; ########## my $dh = DBI->connect(...); sub old { my ($class)=@_; my $hash ={}; bless ($hash, $class); } sub just_do_it{ my ($self, %in) =@_; my $x = $self->{argument}=$in{argument}; my $y = $dbh->prepare($x); $y ->execute; } 1; ################################ and DBI module here ################################