Hi,

I've hit a wall in passing an object as an argument  in a subroutine (well, 
an object method).  The method/subroutine recognizes that the passed object 
is a reference, but it doesn't recognize it as a blessed reference.  Does 
anyone know how to do that?

Here's a more detailed look at what I'm doing.  I'm writing a Currency class, 
and one of its methods is currency_object_math, which takes a currency object 
as an argument.  So, in the example below, I am trying to add $currency2 
(which will equal $2.00 USD) to $currency1 (which defaults to $0.00 USD)...

my $currency1 = Currency->new();
my $currency2 = Currency->new();

$currency2->set('whole_units', 2);

$currency1->currency_object_math(\$currency2, '+');

In the above example, currency_object_math recognizes $currency2 as a simple 
reference, not a blessed reference.  Can anyone tell me what I'm doing wrong 
and/or what I need to do?  I'd appreciate any help I can get.  Thanks!

Cheers,

andrew

P.S. I'm not currently subscribed to the list, since I couldn't handle its 
high traffic volume. :-)  So, please CC me with any suggestions you might 
have.

Reply via email to