passing blessed thingies as parameters

Tony Bowden tony at kasei.com
Fri Dec 28 05:07:14 CST 2001


On Thu, Dec 27, 2001 at 11:48:29PM +0000, Liyang Hu wrote:
> How? I'm not even sure what to look up for this. Say I wanted to do
> 	use Mail::Audit;
>    	sub foo($)
> 	{
> 	    $ma = shift();
> 	    $ma->accept(...yada...);
> 	}
> 	$mail = new Mail::Audit;
> 	foo($mail);
> 
> perl barfs on the $ma = shift() line. Obviously sub foo doesn't even
> know what it was passed, so I don't think $ma->accept()'s going to
> work either.

This works for me ... what problem are you seeing? Is it barfing at
compilation, or run time? What error are you getting?

Tony




More information about the Belfast-pm mailing list