[Omaha.pm] Safely instantiate (or not) a class that may or may notexist?

Jay Hannah jay at jays.net
Fri Dec 16 12:41:32 PST 2005


Kenneth Thompson wrote:
> Any chance this approach might work?
> 
>   my $obj = ref("${namespace}::${partner_id}::OutboundHeader");
>   my $class = $obj || "";
>   return 1 if $class
>   
> (Completely untested, and off the top of my head...)

I don't think so. AFAIK ref doesn't ever instantiate anything.

perldoc -f ref

j


More information about the Omaha-pm mailing list