Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

[udunits] Announcement: Physics::Udunits2, a perl-wrapper for udunits2

I just uploaded a perl-wrapper for the udunits2 library to CPAN. The package name is Physics::Udunits2 and it will appear as Physics-Udunits2-0.03.tar.gz under http://www.perl.com/CPAN/modules/by-authors/id/H/HE/HEIKOK/
It might take some hours to get there due to internal CPAN handling.

Physics::Udunits2 is a thin wrapper around the udunits2 package. It supports most functions of the C-API documentation. The following function groups have been left out in the current release: visitors, formatting of unit-names, and mapping of names and symbols.


A short example:

  use Physics::Udunits2;
  my $system = new Physics::Udunits2();
  my $mUnit = $system->getUnit("m");
  my $kmUnit = $system->getUnit("km");
  if ($mUnit->isConvertibleTo($kmUnit)) {
     my $converter = $mUnit->getConverterTo($kmUnit);
     foreach my $num (1..1000) {
           printf("%fm = %fkm\n", $num, $converter->convert($num));
     }
  }


Feedback is welcome.

Heiko



  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the udunits archives: