tadman has asked for the wisdom of the Perl Monks concerning the following question:
Now, writing the method to make the output text is simple enough, but getting it to execute is currently a mystery.my $donut = Donut::Filled->new (Filling => "Cherry"); $donut->add (Topping => "Hawaiian"); print $donut; # Should be "Cherry filling with Hawaiian topping" # Is now "Donut::Filled=HASH(0xXXXXXXXX)"
print "Your order is for $count donuts which are specified with $donut<BR><BR>\n";Versus, say, something like:
Any ideas?print "Your order is for $count donuts which are specified with " .$donut->printed()."<BR><BR>\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Override Data Display Method
by shotgunefx (Parson) on Mar 08, 2002 at 00:07 UTC | |
|
Re: Override Data Display Method
by mpeppler (Vicar) on Mar 08, 2002 at 00:10 UTC | |
|
Re: Override Data Display Method
by maverick (Curate) on Mar 07, 2002 at 23:43 UTC | |
by tadman (Prior) on Mar 07, 2002 at 23:46 UTC | |
|
Re: Override Data Display Method
by rinceWind (Monsignor) on Mar 08, 2002 at 01:11 UTC | |
|
Re: Override Data Display Method
by Juerd (Abbot) on Mar 08, 2002 at 09:02 UTC |