glen

Untitled

Apr 14th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. http://cpansearch.perl.org/src/MSULLAND/Device-USB-PCSensor-HidTEMPer-0.03/lib/Device/USB/PCSensor/HidTEMPer/TEMPer.pm
  2.  
  3.  
  4. # This functions detects the correct object to be created and returned.
  5. # Returns undef if not supported device was found.
  6. sub _init_device
  7. {
  8. my $prototype = Device::USB::PCSensor::HidTEMPer::Device->new( $_[0] );
  9. my $parameters = (SUPPORTED_DEVICES)[0]{$prototype->identifier()};
  10.  
  11. return undef unless defined $parameters;
  12.  
  13. bless $prototype, $parameters->{module};
  14. return $prototype->init();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment