as the question says i would like to load and execute a method on an object that is loaded from one module to my object method in my *.pm module that i call from my script. example:
the error stmt i'm getting is :############################## script ############################## use strict; use MyTest; my $stm = "create table TEST (N01 varchar(100)not null, N02 integer no +t 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 ################################
DBD::SQLite::db prepare failed: unrecognized token: "0x225fc4"(1) at dbdimp.c li ne 271 at Lib/MyTest.pm line 38, <> line 2. DBD::SQLite::db prepare failed: unrecognized token: "0x225fc4"(1) at dbdimp.c li ne 271 at Lib/MyTest.pm line 38, <> line 2.
any ideas how to make this work?
thnx!
In reply to load object from a module to a module whose method is then used in a script by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |