[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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...)
  


---------------------

Howdy! I've got a chuck of code. For most partner_id's, I have an
OutboundHeader. For some, though, I don't. So I'm trying to safely trap
the possible non-existance using eval like so: