|
In a message dated 2/17/2006 5:46:24 P.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> so .... why does it not work -- any ideas?
> > <quote who="Brian Raven"> > > Mario Sanchez <> wrote: > >> hello > >> > >> the following statement works perfectly: > >> > >> $sth->bind_columns(\$f1data, \$f2data, \$f3data); > >> > >> however, if i do this > >> > >> $bind = "bind_columns(" . "\\" . '$f1data, ' . "\\" . '$f2data, ' . > >> "\\" . '$f3data)'; > >> $sth->$bind; > >> > >> when i run the script i get ... > >> Can't locate object method "bind_columns(\$f1data, \$f2data, > >> \$f3data)" via package "DBI::st" at 2makexml.pl line 54. > >> > >> any suggestions???? > > > > Yes. Don't do that. > > > > Seriously though, what's wrong with the statement that works perfectly. > > I find it hard to imagine what you are trying to accomplish that makes > > you want to try that. Perhaps you could explain. > > > > HTH > > > > -- > > Brian Raven it doesn't work because you are trying to create a soft reference to a
function named -- literally -- ``bind_columns(\$f1data, \$f2data, \$f3data)''
and then invoke it as a member function of whatever object $sth references, and
such a function does not exist in any accessible namespace.
try something like this (UNTESTED):
my $sth = something();
my $bind_statement = q[ $sth->bind_columns(\$f1data,
\$f2data, \$f3data) ];
my $result = eval $bind_statement;
or like this (ALSO UNTESTED):
my $bind_parameters = q[ (\$f1data, \$f2data, \$f3data)
];
my $result = $sth->bind_columns( eval
$bind_parameters );
hth -- bill walters
|
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
