Hello, After having worked with Perl quite a bit and written lots of modules over the past 2 years for personal use, I think some of the work is ready for sharing with the Perl community. I am an electrical engineer and mainly use Perl for writing (parts of) CAD tools, so my focus is on mathematical issues and processing of text files in an unspecified number of formats. I have already shared much code with my colleagues (I estimate about 40 use it, with about 10 amongst them being aware of it). I have already posted a specific request about releasing modules for handling files written in a format named Spice. Although this is a very popular format in the field of analog circuit simulation, I got no response. But I think interest in this and other modules could arise any moment. There are some freeware projects around for writing circuit simulators, and their analog parts may benefit from such code. I must admit, though, that all this is still hypothetical. Anyway, I hope this low response does not keep you from letting me share my efforts. I have reaped many benefits (not financially ;-) from using modules available at CPAN, and think I have the needed experience and discipline to give the people something useful instead of letting them work out a mess. My personal data: name: Wim Verhaegen e-mail: [EMAIL PROTECTED] homepage: http://www.esat.kuleuven.ac.be/~verhaege/ preferred id: WIMV To start with, I would submit Number::Spice, a relatively small module for converting to and from a special number format with literal suffices, which is allowed by the spice simulator. DSLI entry: Number::Spice adpf Conversion of Spice numbers WIMV Attached you will find a README file for the Number::Spice module. Hope to hear from you soon! Wim -- Wim Verhaegen, Research Assistant Phone: +32-16-321075 K.U.Leuven ESAT-MICAS Fax: +32-16-321975 Kard. Mercierlaan 94 [EMAIL PROTECTED] B-3001 Leuven, Belgium http://www.esat.kuleuven.ac.be/~verhaege/
Number::Spice groups functions for converting plain decimal numbers to/from the shortened Spice syntax. Spice syntax provides a shortcut for writing down numbers in scientific notation, by appending a suffix to the value which corresponds to a numeric multiplier. The following table lists the minimal suffices and the corresponding multiplier: T 1.0E12 G 1.0E9 MEG 1.0E6 X 1.0E6 K 1.0E3 M 1.0E-3 MIL 2.54E-5 (i.e. 1/1000 inch) U 1.0E-6 N 1.0E-9 P 1.0E-12 F 1.0E-15 A 1.0E-18 Following functions are available: pattern returns a regular expression matching a spice number is_spice_number returns true when the given string is a clean spice number split_spice_number returns the parts in a spice number (string) suffix_value returns the numeric multiplier corresponding to a suffix spice_to_number converts a spice number (string) to a float number_to_spice converts a float to the shortest spice number (string) normalize_spice_number converts a spice number (string) to its shortest equivalent The following scalars are available for exporting: $RE_NUMBER regular expression matching a float $RE_SPICE_SUFFIX regular expression matching a spice suffix $RE_SPICE_NUMBER regular expression matching a spice number Copyright (c) 2000 Wim Verhaegen. All rights reserved. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself.