Data::SImeasures - The checks if something is a SI measure or not.
Version 0.0.0
use Data::SImeasures; my $sim = Data::SImeasures->new; ...
It is worth noting that some measures are present more than once as that is more than one common form. These are listed below.
amp ampere meter metre Celsius degree Celsius
This module does have issues dealing with ohm and Celsius as when it comes to the symbol as depending on the source, it may be represented differently. This will be fixed eventually.
This initilizes the object.
my $sim=Data::SImeasures->new;
This returns the symbol for the specified measure.
If if it ohm or Celsius, undef is returned.
my $symbol=$self->getSymbol( $symbol ); if ( $sim->error ){ warn('Failed to match the specified measure'); }else{ if ( ! defined( $symbol ) ){ warn( $measure.' is does not have a supported symbol' ); }else{ print "The symbol for ".$measure." is ".$symbol."\n"; } }
This matches measures.
This only matches the name, not the symbol.
If ends in an s, plural, and does not match siemens or Celsius, the end s is removed.
'1' is returned on it being matched and '0' if it is not.
As long as an measure is defined, it wont error.
if ( $sim->match( $measure ) ){ print "It is a valid measure.\n"; }
This matches either the symbol or the name of the measure.
if ( $sim->matchAll( $measure ) ){ print "It is a valid measure.\n"; }
This matches measure symbols.
This currently does not match ohm or Celsius given how problematic matching can be. This is planned to be fixed in later versions.
if ( $sim->matchSymbol( $measure ) ){ print "It is a valid measure.\n"; }
This module is a Error::Helper ojbect so errors can be checked for in the usual fashion.
No measure specified.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-data-simeasures at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-SImeasures. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-data-simeasures at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Data::SImeasures
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-SImeasures
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Data-SImeasures
CPAN Ratings
http://cpanratings.perl.org/d/Data-SImeasures
Search CPAN
http://search.cpan.org/dist/Data-SImeasures/
Copyright 2012 Zane C. Bowers-Hadley.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Data::SImeasures, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::SImeasures
CPAN shell
perl -MCPAN -e shell install Data::SImeasures
For more information on module installation, please visit the detailed CPAN module installation guide.