perl-Data-Decrement-0.002-alt1.noarch.rpm


Advertisement

Description

perl-Data-Decrement - Provide extra magic logic for auto-decrement

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package filename perl-Data-Decrement-0.002-alt1.noarch.rpm
Package name perl-Data-Decrement
Package version 0.002
Package release alt1
Package architecture noarch
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 27.27 KB
Installed size 27.27 KB
Perl's auto-increment operator (`++') has some convenience feature built in.
Quoting the perlop manpage:
The auto-increment operator has a little extra builtin magic to it. If you
increment a variable that is numeric, or that has ever been used in a numeric
context, you get a normal increment. If, however, the variable has been used in
only string contexts since it was set, and has a value that is not the empty
string and matches the pattern "/^[a-zA-Z]*[0-9]*\z/", the increment is done as
a string, preserving each character within its range, with carry:
print ++($foo = "99");      # prints "100"
print ++($foo = "a0");      # prints "a1"
print ++($foo = "Az");      # prints "Ba"
print ++($foo = "zz");      # prints "aaa"
"undef" is always treated as numeric, and in particular is changed to 0 before
incrementing (so that a post-increment of an undef value will return 0 rather
than "undef").
The auto-decrement operator is not magical.
This module provides the `decr()' function to do the decrement equivalent,
although it is not exactly the reverse of the increment operation. In general,
the rule is that `decr(++$a)' should return the same value as the original
`$a' before the auto-increment, with a couple of exception.
=over
=item * Positive integers are decremented as string
Positive integers, including those with zero prefix, are decremented as string.
print decr(-123);            # prints "-124", treated as number
print decr(123);             # prints "122", treated as string
print decr(100);             # prints "099", treated as string
"undef" like in auto-increment is treated as number 0.
print decr(undef);            # prints "-1", treated as number
=item * Decrementing is not done when leftmost digit is already "A", "a", or 0
When carrying over to the left-most digit, and the digit is already "A", "a", or
"0", decrementing is not done. The original value is returned and a warning
"Cannot decrement '<VALUE>'" is issued. Examples:
print decr(0);               # prin...

Alternatives

Package Version Architecture Repository
perl-Data-Decrement - - -

Requires

Name Value
/usr/share/perl5 -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Data/Decrement.pm) = 0.002
perl-Data-Decrement = 0.002-alt1

Download

Type URL
Mirror ftp.altlinux.org
Binary Package perl-Data-Decrement-0.002-alt1.noarch.rpm
Source Package perl-Data-Decrement-0.002-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Data-Decrement rpm package:
    # sudo apt-get install perl-Data-Decrement

Files

Path
/usr/share/doc/perl-Data-Decrement-0.002/Changes
/usr/share/doc/perl-Data-Decrement-0.002/LICENSE
/usr/share/doc/perl-Data-Decrement-0.002/README
/usr/share/perl5/Data/Decrement.pm

See Also

Package Description
perl-Data-Decycle-0.02-alt1.noarch.rpm (Cyclic|Circular) reference decycler
perl-Data-Deduper-0.03-alt1.noarch.rpm remove duplicated item from array
perl-Data-Deep-0.13-alt1.noarch.rpm Manipulation of Deep perl structure
perl-Data-DefGen-1.001003-alt1.noarch.rpm Define and Generate arbitrary data
perl-Data-Default-0.11-alt1.noarch.rpm perl module Data-Default
perl-Data-Define-1.03-alt1.noarch.rpm Make undef's defined
perl-Data-Demos-0.0.2-alt1.noarch.rpm Database Migration Demos
perl-Data-Demos-scripts-0.0.2-alt1.noarch.rpm Data-Demos scripts
perl-Data-Describe-1.03-alt1.noarch.rpm perl module Data-Describe
perl-Data-Dict-0.003-alt1.noarch.rpm Hash-based dictionary object
perl-Data-Diff-0.01-alt1.noarch.rpm data structure comparison module
perl-Data-Difference-0.112850-alt1.noarch.rpm Compare simple hierarchical data
perl-Data-Digest-1.04-alt1.noarch.rpm Objects that represent a digest values
perl-Data-DigestPath-0.04-alt1.noarch.rpm the path generator as digest hash
perl-Data-Dimensions-0.05-alt1.noarch.rpm perl module Data-Dimensions
Advertisement
Advertisement