The first thing that comes to mind in looking is that you are not passing in
any parameters in your test sub. However, you are passing in a parameter in
the sub that doesn't work. Are you sure you are passing what you think into
your subroutine? Try something like printing $_[0], or printing $inref to
see what is actually arriving in your subroutine. (It should be a has
reference if you are passing everything like you are trying to use it. One
of the keys to that hash you are passing should be dbh, so if it is arriving
like you think, you should be able to do:
print "$_\n" foreach sort keys %{$inref};
and one of the keys should be dbh).
If it is not getting there right, then you probably need to check your call
to the subroutine.
After we know this, then we probably have something more to discuss.
Steve H.
-----Original Message-----
From: Jonathan Daigle [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 9:04 AM
To: [EMAIL PROTECTED]
Subject: a better description of the problem.
ok i think my first message wasent giving any info so here a longer one ...
my $lib = Lib->new();
sub some_sub
{
$inref->{dbh}->prepare(qq| SELECT * from affiliate_account|); # for
test purpose only works fine
$lib->some_other_lib_function_just_to_test("hello"); # for test
purpose only works fine
$lib->create_order_redistribution_matrix($inref);
}
in the file Lib.pm
sub create_order_redistribution_matrix
{
my $inref = shift;
my $sth = $inref->{dbh}->prepare(qq|select * from affiliate_account
where aa_affiliateid like "| . lc($inref->{master_affiliate}) . qq|" AND
aa_deleted = 'false'|);
}
# i get this error Can't call method "prepare" on an undefined value at
/var/www/htdocs/cgi-bin//OxcartAPIs/Lib.pm line 731.
can some one can help me please!!!
hope you can understand my english!
- This message (including any attachments) contains confidential information
intended for a specific individual and purpose, and is protected by law. -
If you are not the intended recipient, you should delete this message and
are hereby notified that any disclosure, copying, or distribution of this
message, or the taking of any action based on it, is strictly prohibited.