NAME
    Data::Str2int - int, int str to int; else undef. No warnings

SYNOPSIS
     int, int str to int; else undef. No warnings.

     #####
     # Subroutine interface
     #  
     use Data::Str2Num qw(str2int);

     $integer = str2int($string);

DESCRIPTION
    The Data::SecsPack program module supercedes this program module. The
    "Data::SecsPack::str2int" subroutine, in a scalar context, behaves the
    same and supercedes C&<Data::StrInt::str2int>. In time, this module will
    vanish.

    The "str2int" subroutine translates an scalar numeric string and a
    scalar number to a scalar integer; otherwsie it returns an "undef".

    Perl itself has a documented function, '0+$x', that converts a number
    scalar so that its internal storage is an integer (See p.351, 3rd
    Edition of Programming Perl). "If it cannot perform the conversion, it
    leaves the integer 0." In addition the "0 +" also produces a warning.

    So how do you tell a conversion failure from the number 0? Compare the
    output to the input? Trap the warning? Surprising not all Perls, some
    Microsoft Perls in particular, may leave the internal storage as a
    scalar string and do not do numeric strings. Perl 5.6 under Microsoft
    has a broken '0+' and is no longer actively supported. It is still very
    popular and widely used on web hosting computers.

    What is "$x" for the following, Perl 5.6, Microsoft:

     my $x = 0 + '0x100';  # $x is 0 with a warning  

    The "str2int" provides a different behavior that is more usefull in many
    situations as follows:

     $x = str2int('033');   # $x is 27
     $x = str2int('0xFF');  # $x is 255
     $x = str2int('255');   # $x is 255
     $x = str2int('hello'); # $x is undef no warning
     $x = str2int(0.5);     # $x is undef no warning
     $x = str2int(1E0);     # $x is 1 
     $x = str2int(0xf);     # $x is 15
     $x = str2int(1E30);    # $x is undef no warning

    The "str2int" pulls out anything that resembles an integer; otherwise it
    returns undef with no warning. This makes the "str2int" subroutine not
    only useful for forcing an integer conversion but also for parsing
    scalars from strings.

    The Perl code is a few lines without starting any whatevers with a Perl
    "eval" and attempting to trap all the warnings and dies, and without the
    regular expression engine with its overhead. The code works on broken
    Microsoft 5.6 Perls.

SEE ALSO
    Data::SecsPack
Title Page
     Software Version Description

     for

     Data::Str2Num - Obsoleted by Data::SecsPack. int str to int; else undef. No warnings.

     Revision: D

     Version: 0.05

     Date: 2004/04/25

     Prepared for: General Public 

     Prepared by:  SoftwareDiamonds.com E<lt>support@SoftwareDiamonds.comE<gt>

     Copyright: copyright  2003 Software Diamonds

     Classification: NONE

1.0 SCOPE
    This paragraph identifies and provides an overview of the released
    files.

  1.1 Identification

    This release, identified in 3.2, is a collection of Perl modules that
    extend the capabilities of the Perl language.

  1.2 System overview

    The "Data::Str2Num" module extends the Perl language (the system).

    The "Data::Str2int" module translates an scalar string to a scalar
    integer. Perl itself has a documented function, '0+$x', that converts a
    scalar to so that its internal storage is an integer (See p.351, 3rd
    Edition of Programming Perl). If it cannot perform the conversion, it
    leaves the integer 0. Surprising not all Perls, some Microsoft Perls in
    particular, may leave the internal storage as a scalar string.

    The "str2int" function is basically the same except if it cannot perform
    the conversion to an integer, it returns an "undef" instead of a 0.
    Also, if the string is a decimal or floating point, it will return an
    undef. This makes it not only useful for forcing an integer conversion
    but also for testing a scalar to see if it is in fact an integer scalar.

  1.3 Document overview.

    This document releases Data::Str2Num version 0.05 providing a
    description of the inventory, installation instructions and other
    information necessary to utilize and track this release.

3.0 VERSION DESCRIPTION
    All file specifications in this SVD use the Unix operating system file
    specification.

  3.1 Inventory of materials released.

    This document releases the file

     Data-Str2Num-0.05.tar.gz

    found at the following repository(s):

      http://www.softwarediamonds/packages/
      http://www.perl.com/CPAN/authors/id/S/SO/SOFTDIA/

    Restrictions regarding duplication and license provisions are as
    follows:

    Copyright.
        copyright  2003 Software Diamonds

    Copyright holder contact.
         603 882-0846 E<lt>support@SoftwareDiamonds.comE<gt>

    License.
        Software Diamonds permits the redistribution and use in source and
        binary forms, with or without modification, provided that the
        following conditions are met:

        1   Redistributions of source code, modified or unmodified must
            retain the above copyright notice, this list of conditions and
            the following disclaimer.

        2   Redistributions in binary form must reproduce the above
            copyright notice, this list of conditions and the following
            disclaimer in the documentation and/or other materials provided
            with the distribution.

        SOFTWARE DIAMONDS, http://www.SoftwareDiamonds.com, PROVIDES THIS
        SOFTWARE 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
        BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
        FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
        SOFTWARE DIAMONDS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
        SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
        LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
        USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
        ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING USE OF THIS SOFTWARE, EVEN IF ADVISED OF
        NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE POSSIBILITY
        OF SUCH DAMAGE.

  3.2 Inventory of software contents

    The content of the released, compressed, archieve file, consists of the
    following files:

     file                                                         version date       comment
     ------------------------------------------------------------ ------- ---------- ------------------------
     lib/Docs/Site_SVD/Data_Str2Num.pm                            0.05    2004/04/25 revised 0.04
     MANIFEST                                                     0.05    2004/04/25 generated, replaces 0.04
     Makefile.PL                                                  0.05    2004/04/25 generated, replaces 0.04
     README                                                       0.05    2004/04/25 generated, replaces 0.04
     lib/Data/Str2Num.pm                                          0.04    2004/04/25 revised 0.03
     t/Data/Str2Num.d                                             0.02    2004/04/13 unchanged
     t/Data/Str2Num.pm                                            0.03    2004/04/13 unchanged
     t/Data/Str2Num.t                                             0.03    2004/04/13 unchanged
     t/Data/File/Package.pm                                       1.16    2004/04/25 unchanged
     t/Data/Test/Tech.pm                                          1.21    2004/04/25 revised 1.17
     t/Data/Data/Secs2.pm                                         1.18    2004/04/25 revised 1.15

  3.3 Changes

    Changes are as follows:

    Data::Str2Num 0.01
        Originated

    Data::Str2Num 0.02
        Added 1 to end of the code section. Unix Perls very strict about
        this one.

    Data::Str2Num 0.03
        Change the test so that test support program modules resides in
        distribution directory tlib directory instead of the lib directory.
        Because they are no longer in the lib directory, test support files
        will not be installed as a pre-condition for the test of this
        module. The test of this module will precede immediately. The test
        support files in the tlib directory will vanish after the
        installtion.

    Data::Str2Num 0.04
        The lastest build of Test::STDmaker expects the test library in the
        same directory as the test script. Coordiated with the lastest
        Test::STDmaker by moving the test library from tlib to t/Data, the
        same directory as the test script and deleting the test library
        File::TestPath program module.

        The "Data::Str2Num" module is now obsolete and superceded by the
        "Data::SecsPack" module. Replace all subroutines to call the
        compatible subroutines in the "Data:SecsPack" module and make any
        necessary manipulates to provide exact equivalent of the old
        "Data::Str2Num" subroutines.

    Data::Str2Num 0.05
        Changed the abstract to 'obsoleted by Data::Secs2'

  3.4 Adaptation data.

    This installation requires that the installation site has the Perl
    programming language installed. There are no other additional
    requirements or tailoring needed of configurations files, adaptation
    data or other software needed for this installation particular to any
    installation site.

  3.5 Related documents.

    There are no related documents needed for the installation and test of
    this release.

  3.6 Installation instructions.

    Instructions for installation, installation tests and installation
    support are as follows:

    Installation Instructions.
        To installed the release file, use the CPAN module pr PPM module in
        the Perl release or the INSTALL.PL script at the following web site:

         http://packages.SoftwareDiamonds.com

        Follow the instructions for the the chosen installation software.

        If all else fails, the file may be manually installed. Enter one of
        the following repositories in a web browser:

          http://www.softwarediamonds/packages/
          http://www.perl.com/CPAN/authors/id/S/SO/SOFTDIA/

        Right click on 'Data-Str2Num-0.05.tar.gz' and download to a
        temporary installation directory. Enter the following where $make is
        'nmake' for microsoft windows; otherwise 'make'.

         gunzip Data-Str2Num-0.05.tar.gz
         tar -xf Data-Str2Num-0.05.tar
         perl Makefile.PL
         $make test
         $make install

        On Microsoft operating system, nmake, tar, and gunzip must be in the
        exeuction path. If tar and gunzip are not install, download and
        install unxutils from

         http://packages.softwarediamonds.com

    Prerequistes.
         'Data::SecsPack' => '0.01',

    Security, privacy, or safety precautions.
        None.

    Installation Tests.
        Most Perl installation software will run the following test
        script(s) as part of the installation:

         t/Data/Str2Num.t

    Installation support.
        If there are installation problems or questions with the
        installation contact

         603 882-0846 E<lt>support@SoftwareDiamonds.comE<gt>

  3.7 Possible problems and known errors

    There is still much work needed to ensure the quality of this module as
    follows:

    *   State the functional requirements for each method including not only
        the GO paths but also what to expect for the NOGO paths

    *   All the tests are GO path tests. Should add NOGO tests.

    *   Add the requirements addressed as *# R: * comment to the tests

    *   Write a program to build a matrix to trace test step to the
        requirements and vice versa by parsing the *# R: * comments.
        Automatically insert the matrix in the Test::TestUtil POD.

4.0 NOTES
    The following are useful acronyms:

    .d  extension for a Perl demo script file

    .pm extension for a Perl Library Module

    .t  extension for a Perl test script file

2.0 SEE ALSO
    Data::SecsPack
    Docs::US_DOD::SVD
