NAME
Data::SImeasures - The checks if something is a SI measure or not.
VERSION
Version 0.0.0
SYNOPSIS
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.
METHODS
new
This initilizes the object.
my $sim=Data::SImeasures->new;
getSymbol
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";
}
}
match
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";
}
matchAll
This matches either the symbol or the name of the measure.
if ( $sim->matchAll( $measure ) ){
print "It is a valid measure.\n";
}
matchSymbol
This matches measure symbols.
'1' is returned on it being matched and '0' if it is not.
As long as an measure is defined, it wont error.
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";
}
ERROR CODES
This module is a Error::Helper ojbect so errors can be checked for in the usual fashion.
1
No measure specified.
AUTHOR
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
BUGS
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.
SUPPORT
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)
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
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.