String::Incremental::Char
use String::Incremental::Char; my $ch = String::Incremental::Char->new( order => 'abcd' ); print "$ch"; # -> 'a'; $ch++; $ch++; $ch++; print "$ch"; # -> 'd'; $ch++; # dies my $ch1 = String::Incremental::Char->new( order => ['a'..'c'] ); my $ch2 = String::Incremental::Char->new( order => ['x'..'z'], upper => $ch1 ); print "${ch1}${ch2}"; # -> ax $ch2++; $ch2++; print "${ch1}${ch2}"; # -> az $ch2++; print "${ch1}${ch2}"; # -> bx $ch1++; print "${ch1}${ch2}"; # -> cx ... print "${ch1}${ch2}"; # -> cz $ch2++; # dies
String::Incremental::Char is ...
%args:
order : Str|ArrayRef
incrementation rule
upper : String::Incremental::Char
upper-digit char as String::Incremental::Char instance
returns "current" character.
following two variables are equivalent:
my $a = $ch->as_string(); my $b = "$ch";
sets "current" state as $val.
if $opts->{test} is true, "current" state is not update, only returns or dies.
increases position of order and returns its character.
following two operation are equivalent:
$ch->increment(); $ch++;
decreases position of order and returns its character.
$ch->decrement(); $ch--;
Copyright (C) issm.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
issm <issmxx@gmail.com>
To install String::Incremental, copy and paste the appropriate command in to your terminal.
cpanm
cpanm String::Incremental
CPAN shell
perl -MCPAN -e shell install String::Incremental
For more information on module installation, please visit the detailed CPAN module installation guide.