returns
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1871
Return-RST 1.1
Return-RST is a firewalling tool for Linux 2.2.xx systems using IPCHAINS. more>>
Return-RST is a firewalling tool for Linux 2.2.xx systems using IPCHAINS. It uses the netlink device to capture packets and sends TCP RST packets in response to TCP connection requests.
Normal IPCHAINS only allows you to drop packets, or reject packets with an ICMP error message. With Return-RST, you can make it look like there is no server listening, rather than giving away that theyre being filtered to the attacker.
Return-RST was written to overcome the lack of an ipchains policy that can return a RESET packet when denying a TCP connection. The DENY policy just drops the packet, and the REJECT policy sends back an ICMP message. Either policy will pull an attacker off to the fact theyre being filtered.
On the other hand, an RST in response to a TCP SYN packet is what happens when there is no server listening on a port - this program allows you to return this error, so attackers will think that there is no server available.
<<lessNormal IPCHAINS only allows you to drop packets, or reject packets with an ICMP error message. With Return-RST, you can make it look like there is no server listening, rather than giving away that theyre being filtered to the attacker.
Return-RST was written to overcome the lack of an ipchains policy that can return a RESET packet when denying a TCP connection. The DENY policy just drops the packet, and the REJECT policy sends back an ICMP message. Either policy will pull an attacker off to the fact theyre being filtered.
On the other hand, an RST in response to a TCP SYN packet is what happens when there is no server listening on a port - this program allows you to return this error, so attackers will think that there is no server available.
Download (0.013MB)
Added: 2006-07-13 License: GPL (GNU General Public License) Price:
1199 downloads
Contextual::Return 0.1.0
Contextual::Return is a Perl module to create context-senstive return values. more>>
Contextual::Return is a Perl module to create context-senstive return values.
SYNOPSIS
use Contextual::Return;
use Carp;
sub foo {
return
SCALAR { thirty-twelve }
BOOL { 1 }
NUM { 7*6 }
STR { forty-two }
LIST { 1,2,3 }
HASHREF { {name => foo, value => 99} }
ARRAYREF { [3,2,1] }
GLOBREF { *STDOUT }
CODEREF { croak "Dont use this result as code!"; }
;
}
# and later...
if (my $foo = foo()) {
for my $count (1..$foo) {
print "$count: $foo is:n"
. " array: @{$foo}n"
. " hash: $foo->{name} => $foo->{value}n"
;
}
print {$foo} $foo->();
}
Usually, when you need to create a subroutine that returns different values in different contexts (list, scalar, or void), you write something like:
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data,
# depending on call context...
if (wantarray()) {
return @server_data{ qw(name uptime load users) };
}
if (defined wantarray()) {
return $server_data{load};
}
if (!defined wantarray()) {
carp Useless use of get_server_status() in void context;
return;
}
else {
croak q{Bad context! No biscuit!};
}
}
That works okay, but the code could certainly be more readable. In its simplest usage, this module makes that code more readable by providing three subroutines--LIST(), SCALAR(), VOID()--that are true only when the current subroutine is called in the corresponding context:
use Contextual::Return;
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data
# depending on call context...
if (LIST) { return @server_data{ qw(name uptime load users) } }
if (SCALAR) { return $server_data{load} }
if (VOID) { print "$server_data{load}n" }
else { croak q{Bad context! No biscuit!} }
}
Contextual returns
Those three subroutines can also be used in another way: as labels on a series of contextual return blocks (collectively known as a context sequence). When a context sequence is returned, it automatically selects the appropriate contextual return block for the calling context. So the previous example could be written even more cleanly as:
use Contextual::Return;
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data
# depending on call context...
return (
LIST { return @server_data{ qw(name uptime load users) } }
SCALAR { return $server_data{load} }
VOID { print "$server_data{load}n" }
DEFAULT { croak q{Bad context! No biscuit!} }
);
}
The context sequence automatically selects the appropriate block for each call context.
<<lessSYNOPSIS
use Contextual::Return;
use Carp;
sub foo {
return
SCALAR { thirty-twelve }
BOOL { 1 }
NUM { 7*6 }
STR { forty-two }
LIST { 1,2,3 }
HASHREF { {name => foo, value => 99} }
ARRAYREF { [3,2,1] }
GLOBREF { *STDOUT }
CODEREF { croak "Dont use this result as code!"; }
;
}
# and later...
if (my $foo = foo()) {
for my $count (1..$foo) {
print "$count: $foo is:n"
. " array: @{$foo}n"
. " hash: $foo->{name} => $foo->{value}n"
;
}
print {$foo} $foo->();
}
Usually, when you need to create a subroutine that returns different values in different contexts (list, scalar, or void), you write something like:
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data,
# depending on call context...
if (wantarray()) {
return @server_data{ qw(name uptime load users) };
}
if (defined wantarray()) {
return $server_data{load};
}
if (!defined wantarray()) {
carp Useless use of get_server_status() in void context;
return;
}
else {
croak q{Bad context! No biscuit!};
}
}
That works okay, but the code could certainly be more readable. In its simplest usage, this module makes that code more readable by providing three subroutines--LIST(), SCALAR(), VOID()--that are true only when the current subroutine is called in the corresponding context:
use Contextual::Return;
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data
# depending on call context...
if (LIST) { return @server_data{ qw(name uptime load users) } }
if (SCALAR) { return $server_data{load} }
if (VOID) { print "$server_data{load}n" }
else { croak q{Bad context! No biscuit!} }
}
Contextual returns
Those three subroutines can also be used in another way: as labels on a series of contextual return blocks (collectively known as a context sequence). When a context sequence is returned, it automatically selects the appropriate contextual return block for the calling context. So the previous example could be written even more cleanly as:
use Contextual::Return;
sub get_server_status {
my ($server_ID) = @_;
# Acquire server data somehow...
my %server_data = _ascertain_server_status($server_ID);
# Return different components of that data
# depending on call context...
return (
LIST { return @server_data{ qw(name uptime load users) } }
SCALAR { return $server_data{load} }
VOID { print "$server_data{load}n" }
DEFAULT { croak q{Bad context! No biscuit!} }
);
}
The context sequence automatically selects the appropriate block for each call context.
Download (0.022MB)
Added: 2007-01-18 License: Perl Artistic License Price:
1009 downloads
Contextual::Return::Failure 0.1.0
Contextual::Return::Failure is a Perl module with a utility module for Contextual::Return. more>>
Contextual::Return::Failure is a Perl module with a utility module for Contextual::Return.
NOTE
Contains no user serviceable parts. See Contextual::Return instead.
<<lessNOTE
Contains no user serviceable parts. See Contextual::Return instead.
Download (0.022MB)
Added: 2007-01-17 License: Perl Artistic License Price:
1010 downloads
ExtUtils::F77 1.15
ExtUtils::F77 is a simple Perl interface to F77 libs. more>>
ExtUtils::F77 is a simple Perl interface to F77 libs.
This module tries to figure out how to link C programs with Fortran subroutines on your system. Basically one must add a list of Fortran runtime libraries. The problem is their location and name varies with each OS/compiler combination!
This module tries to implement a simple rule-of-thumb database for various flavours of UNIX systems.
A simple self-documenting Perl database of knowledge/code for figuring out how to link for various combinations of OS and compiler is embedded in the modules Perl code. Please help save the world by sending database entries for your system to kgb@aaoepp.aao.gov.au
The library list which the module returns can be explicitly overridden by setting the environment variable F77LIBS, e.g.
% setenv F77LIBS "-lfoo -lbar"
% perl Makefile.PL
...
SYNOPSIS
use ExtUtils::F77; # Automatic guess
use ExtUtils::F77 qw(sunos); # Specify system
use ExtUtils::F77 qw(linux g77); # Specify system and compiler
$fortranlibs = ExtUtils::F77->runtime;
METHODS
The following methods are provided:
runtime
Returns a list of F77 runtime libraries.
$fortranlibs = ExtUtils::F77->runtime;
runtimeok
Returns TRUE only if runtime libraries have been found successfully.
trail_
Returns true if F77 names have trailing underscores.
compiler
Returns command to execute the compiler (e.g. f77).
cflags
Returns compiler flags.
testcompiler
Test to see if compiler actually works.
More methods will probably be added in the future.
<<lessThis module tries to figure out how to link C programs with Fortran subroutines on your system. Basically one must add a list of Fortran runtime libraries. The problem is their location and name varies with each OS/compiler combination!
This module tries to implement a simple rule-of-thumb database for various flavours of UNIX systems.
A simple self-documenting Perl database of knowledge/code for figuring out how to link for various combinations of OS and compiler is embedded in the modules Perl code. Please help save the world by sending database entries for your system to kgb@aaoepp.aao.gov.au
The library list which the module returns can be explicitly overridden by setting the environment variable F77LIBS, e.g.
% setenv F77LIBS "-lfoo -lbar"
% perl Makefile.PL
...
SYNOPSIS
use ExtUtils::F77; # Automatic guess
use ExtUtils::F77 qw(sunos); # Specify system
use ExtUtils::F77 qw(linux g77); # Specify system and compiler
$fortranlibs = ExtUtils::F77->runtime;
METHODS
The following methods are provided:
runtime
Returns a list of F77 runtime libraries.
$fortranlibs = ExtUtils::F77->runtime;
runtimeok
Returns TRUE only if runtime libraries have been found successfully.
trail_
Returns true if F77 names have trailing underscores.
compiler
Returns command to execute the compiler (e.g. f77).
cflags
Returns compiler flags.
testcompiler
Test to see if compiler actually works.
More methods will probably be added in the future.
Download (0.010MB)
Added: 2007-05-02 License: Perl Artistic License Price:
917 downloads
MetaTrans::Languages 1.04
MetaTrans::Languages Perl module contains a simple database of most of the known languages. more>>
MetaTrans::Languages Perl module contains a simple "database" of most of the known languages. Extracted from MARC codes for languages, http://www.loc.gov/marc/languages/.
SYNOPSIS
use MetaTrans::Languages qw(get_lang_by_code get_code_by_lang);
print get_lang_by_code(afr); # prints Afrikaans
print get_code_by_lang(Afrikaans); # prints afr
FUNCTIONS
get_lang_by_code($code)
Returns the name of the language with $code or undef if no language with such a $code is known.
get_code_by_lang($language)
Returns the code of the $language or undef if the language is unknown.
is_known_lang($code)
Returns true if the language with $code exists in the "database", false otherwise.
get_langs_hash
Returns the {code_1 => language_1, code_2 => language_2, ...} hash containing all known languages and their codes.
get_langs_hash_rev
Returns the {language_1 => code_1, language_2 => code_2, ...} hash containing all known languages and their codes.
<<lessSYNOPSIS
use MetaTrans::Languages qw(get_lang_by_code get_code_by_lang);
print get_lang_by_code(afr); # prints Afrikaans
print get_code_by_lang(Afrikaans); # prints afr
FUNCTIONS
get_lang_by_code($code)
Returns the name of the language with $code or undef if no language with such a $code is known.
get_code_by_lang($language)
Returns the code of the $language or undef if the language is unknown.
is_known_lang($code)
Returns true if the language with $code exists in the "database", false otherwise.
get_langs_hash
Returns the {code_1 => language_1, code_2 => language_2, ...} hash containing all known languages and their codes.
get_langs_hash_rev
Returns the {language_1 => code_1, language_2 => code_2, ...} hash containing all known languages and their codes.
Download (0.032MB)
Added: 2007-06-01 License: Perl Artistic License Price:
875 downloads
Religion::Islam::Quran 1.0
Religion::Islam::Quran - Holy Quran book searchable database multi-lingual in both text and unicode formats. more>>
Religion::Islam::Quran - Holy Quran book searchable database multi-lingual in both text and unicode formats.
SYNOPSIS
#---------------------------------------------------------------
use Religion::Islam::Quran;
#---------------------------------------------------------------
#create new object with default options, Arabic language, none unicode
my $quran = Religion::Islam::Quran->new();
# or for unicode format and select the Arabic Language:
my $quran = Religion::Islam::Quran->new(Unicode => 1, Language=>Arabic);
# you can also specifiy your own database files path:
my $quran = Religion::Islam::Quran->new(DatabasePath => ./Quran/mydatabase);
#---------------------------------------------------------------
#Returns the available Quran databases
@Languages = $quran->GetLanguages();
#---------------------------------------------------------------
# returns all the quran surahs count.
$surahs = $quran->SurahCount; # returns 114
#---------------------------------------------------------------
# returns all the quran ayats count.
$ayats = $quran->AyahCount; # returns 6236
#---------------------------------------------------------------
#returns all surah ayats Quran in an array.
@surah = $quran->Surah(1);
#---------------------------------------------------------------
#returns the number of surah ayats.
$surah_number = 1; # 1 to 114
$surah_ayats = $quran->SurahAyahCount($surah_number);
#---------------------------------------------------------------
# returns the surah name using the surah number from 1 to 114.
$surah_name = $quran->SurahName($surah_number);
#---------------------------------------------------------------
# returns Quran text of specific surah ayah .
$ayah = $quran->Ayah($surah_number, $ayah_number);
#---------------------------------------------------------------
# returns Quran text of specific surah ayah range in an array .
@ayats = $quran->Ayats($surah_number, $from_ayah, $to_ayah);
#---------------------------------------------------------------
# returns all the Quran text of specific surah in an array.
@ayats = $quran->Surah($surah_number);
#---------------------------------------------------------------
# returns the surah number using the surah name in Quran sort.
$surah_number = $quran->surah_number($surah_name);
#---------------------------------------------------------------
# returns the names of each surah in the Quran sort order.
@surahs_name = $quran->SurahsNames();
#---------------------------------------------------------------
# returns the ayats number for each surah in the Quran sort order.
@surahs_ayats = $quran->SurahsAyats();
#---------------------------------------------------------------
# search specific Surah for specific text and returns the ayahs numbers
@ayats = $quran->SearchSurah($surah, $findwhat);
#---------------------------------------------------------------
#Remove Diacritic from Arabic Text
$TextWithoutDiacritic = $quran->RemoveDiacritic($TextWithDiacritic);
#---------------------------------------------------------------
#The Wajib Sajdah of the Quran
#In four Surahs of the Quran there are ayats of sajdah that if a person reads one
#of these ayats, or if he hears someone else recite one of these ayats, once the
#ayat is finished, one must immediately go into sajdah.
#Returns the Surah=>Ayah pairs
%SajdahCompulsaryAyats = $quran->SajdahCompulsaryAyats();
print $quran->IsSajdahCompulsaryAyah($surah, $ayah);
#The recommended (mustahab) Sajdah of the Quran
#Returns the Surah=>Ayah pairs
%SajdahRecommendedAyats = $quran->SajdahRecommendedAyats();
print $quran->IsSajdahRecommendedAyah($surah, $ayah);
#Surah Number Order of Revelation
#Returns surah number=>order of revelation pairs
%OrderOfRevelation = $quran->OrderOfRevelation();
print "Surah Order Of Revelation: " . $quran->SurahOrderOfRevelation($surah);
#Where each surah revealed, Mekkah or Medianh
#Return 1 for Medinah and 0 for Mekkah
print $quran->SurahRevelation($surah);
print $quran->SurahNameArabicUnicode($surah);
This module contains the full Holy Quran Book database searchable and provides many methods for retriving whole quran, specific surahs, or specific ayats and information about Quran and each surah in different languages and transliterations. Quran database files are simply text files pipe separated each line is formated as:
< SurahNumber >|< AyahNumber >|< AyahText >< CRLF >
Database text files located in the module directory /Religion/Islam/Quran. Default module comes with the Quran Arabic and some other translations. You can download more quran translations and transliterations from www.islamware.com.
<<lessSYNOPSIS
#---------------------------------------------------------------
use Religion::Islam::Quran;
#---------------------------------------------------------------
#create new object with default options, Arabic language, none unicode
my $quran = Religion::Islam::Quran->new();
# or for unicode format and select the Arabic Language:
my $quran = Religion::Islam::Quran->new(Unicode => 1, Language=>Arabic);
# you can also specifiy your own database files path:
my $quran = Religion::Islam::Quran->new(DatabasePath => ./Quran/mydatabase);
#---------------------------------------------------------------
#Returns the available Quran databases
@Languages = $quran->GetLanguages();
#---------------------------------------------------------------
# returns all the quran surahs count.
$surahs = $quran->SurahCount; # returns 114
#---------------------------------------------------------------
# returns all the quran ayats count.
$ayats = $quran->AyahCount; # returns 6236
#---------------------------------------------------------------
#returns all surah ayats Quran in an array.
@surah = $quran->Surah(1);
#---------------------------------------------------------------
#returns the number of surah ayats.
$surah_number = 1; # 1 to 114
$surah_ayats = $quran->SurahAyahCount($surah_number);
#---------------------------------------------------------------
# returns the surah name using the surah number from 1 to 114.
$surah_name = $quran->SurahName($surah_number);
#---------------------------------------------------------------
# returns Quran text of specific surah ayah .
$ayah = $quran->Ayah($surah_number, $ayah_number);
#---------------------------------------------------------------
# returns Quran text of specific surah ayah range in an array .
@ayats = $quran->Ayats($surah_number, $from_ayah, $to_ayah);
#---------------------------------------------------------------
# returns all the Quran text of specific surah in an array.
@ayats = $quran->Surah($surah_number);
#---------------------------------------------------------------
# returns the surah number using the surah name in Quran sort.
$surah_number = $quran->surah_number($surah_name);
#---------------------------------------------------------------
# returns the names of each surah in the Quran sort order.
@surahs_name = $quran->SurahsNames();
#---------------------------------------------------------------
# returns the ayats number for each surah in the Quran sort order.
@surahs_ayats = $quran->SurahsAyats();
#---------------------------------------------------------------
# search specific Surah for specific text and returns the ayahs numbers
@ayats = $quran->SearchSurah($surah, $findwhat);
#---------------------------------------------------------------
#Remove Diacritic from Arabic Text
$TextWithoutDiacritic = $quran->RemoveDiacritic($TextWithDiacritic);
#---------------------------------------------------------------
#The Wajib Sajdah of the Quran
#In four Surahs of the Quran there are ayats of sajdah that if a person reads one
#of these ayats, or if he hears someone else recite one of these ayats, once the
#ayat is finished, one must immediately go into sajdah.
#Returns the Surah=>Ayah pairs
%SajdahCompulsaryAyats = $quran->SajdahCompulsaryAyats();
print $quran->IsSajdahCompulsaryAyah($surah, $ayah);
#The recommended (mustahab) Sajdah of the Quran
#Returns the Surah=>Ayah pairs
%SajdahRecommendedAyats = $quran->SajdahRecommendedAyats();
print $quran->IsSajdahRecommendedAyah($surah, $ayah);
#Surah Number Order of Revelation
#Returns surah number=>order of revelation pairs
%OrderOfRevelation = $quran->OrderOfRevelation();
print "Surah Order Of Revelation: " . $quran->SurahOrderOfRevelation($surah);
#Where each surah revealed, Mekkah or Medianh
#Return 1 for Medinah and 0 for Mekkah
print $quran->SurahRevelation($surah);
print $quran->SurahNameArabicUnicode($surah);
This module contains the full Holy Quran Book database searchable and provides many methods for retriving whole quran, specific surahs, or specific ayats and information about Quran and each surah in different languages and transliterations. Quran database files are simply text files pipe separated each line is formated as:
< SurahNumber >|< AyahNumber >|< AyahText >< CRLF >
Database text files located in the module directory /Religion/Islam/Quran. Default module comes with the Quran Arabic and some other translations. You can download more quran translations and transliterations from www.islamware.com.
Download (1.7MB)
Added: 2007-05-24 License: Perl Artistic License Price:
891 downloads
List::MoreUtils 0.22
List::MoreUtils is a Perl module that can provide the stuff missing in List::Util. more>>
List::MoreUtils is a Perl module that can provide the stuff missing in List::Util.
SYNOPSIS
use List::MoreUtils qw(any all none notall true false firstidx first_index
lastidx last_index insert_after insert_after_string
apply after after_incl before before_incl indexes
firstval first_value lastval last_value each_array
each_arrayref pairwise natatime mesh zip uniq minmax);
List::MoreUtils provides some trivial but commonly needed functionality on lists which is not going to go into List::Util.
All of the below functions are implementable in only a couple of lines of Perl code. Using the functions from this module however should give slightly better performance as everything is implemented in C. The pure-Perl implementation of these functions only serves as a fallback in case the C portions of this module couldnt be compiled on this machine.
any BLOCK LIST
Returns a true value if any item in LIST meets the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "At least one value undefined"
if any { !defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
all BLOCK LIST
Returns a true value if all items in LIST meet the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "All items defined"
if all { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
none BLOCK LIST
Logically the negation of any. Returns a true value if no item in LIST meets the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "No value defined"
if none { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
notall BLOCK LIST
Logically the negation of all. Returns a true value if not all items in LIST meet the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "Not all values defined"
if notall { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
true BLOCK LIST
Counts the number of elements in LIST for which the criterion in BLOCK is true. Sets $_ for each item in LIST in turn:
printf "%i item(s) are defined", true { defined($_) } @list;
false BLOCK LIST
Counts the number of elements in LIST for which the criterion in BLOCK is false. Sets $_ for each item in LIST in turn:
printf "%i item(s) are not defined", false { defined($_) } @list;
firstidx BLOCK LIST
first_index BLOCK LIST
Returns the index of the first element in LIST for which the criterion in BLOCK is true. Sets $_ for each item in LIST in turn:
my @list = (1, 4, 3, 2, 4, 6);
printf "item with index %i in list is 4", firstidx { $_ == 4 } @list;
__END__
item with index 1 in list is 4
Returns -1 if no such item could be found.
first_index is an alias for firstidx.
<<lessSYNOPSIS
use List::MoreUtils qw(any all none notall true false firstidx first_index
lastidx last_index insert_after insert_after_string
apply after after_incl before before_incl indexes
firstval first_value lastval last_value each_array
each_arrayref pairwise natatime mesh zip uniq minmax);
List::MoreUtils provides some trivial but commonly needed functionality on lists which is not going to go into List::Util.
All of the below functions are implementable in only a couple of lines of Perl code. Using the functions from this module however should give slightly better performance as everything is implemented in C. The pure-Perl implementation of these functions only serves as a fallback in case the C portions of this module couldnt be compiled on this machine.
any BLOCK LIST
Returns a true value if any item in LIST meets the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "At least one value undefined"
if any { !defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
all BLOCK LIST
Returns a true value if all items in LIST meet the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "All items defined"
if all { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
none BLOCK LIST
Logically the negation of any. Returns a true value if no item in LIST meets the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "No value defined"
if none { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
notall BLOCK LIST
Logically the negation of all. Returns a true value if not all items in LIST meet the criterion given through BLOCK. Sets $_ for each item in LIST in turn:
print "Not all values defined"
if notall { defined($_) } @list;
Returns false otherwise, or undef if LIST is empty.
true BLOCK LIST
Counts the number of elements in LIST for which the criterion in BLOCK is true. Sets $_ for each item in LIST in turn:
printf "%i item(s) are defined", true { defined($_) } @list;
false BLOCK LIST
Counts the number of elements in LIST for which the criterion in BLOCK is false. Sets $_ for each item in LIST in turn:
printf "%i item(s) are not defined", false { defined($_) } @list;
firstidx BLOCK LIST
first_index BLOCK LIST
Returns the index of the first element in LIST for which the criterion in BLOCK is true. Sets $_ for each item in LIST in turn:
my @list = (1, 4, 3, 2, 4, 6);
printf "item with index %i in list is 4", firstidx { $_ == 4 } @list;
__END__
item with index 1 in list is 4
Returns -1 if no such item could be found.
first_index is an alias for firstidx.
Download (0.022MB)
Added: 2007-07-04 License: Perl Artistic License Price:
846 downloads
Parrot::OpTrans::C 0.4.5
Parrot::OpTrans::C is a Perl module Ops to C Code Generation. more>>
Parrot::OpTrans::C is a Perl module for Ops to C Code Generation.
DESCRIPTION
Parrot::OpTrans::C inherits from Parrot::OpTrans to provide a function-based (slow or fast core) run loop.
Instance Methods
core_type()
Returns PARROT_FUNCTION_CORE.
core_prefix()
Returns an empty string.
defines()
Returns the C #define macros for register access etc.
gen_goto($where)
Reimplements the superclass method so that $where is suitably cast.
expr_address($address)
Returns the C code for ADDRESS($address). Called by goto_address().
expr_offset($offset)
Returns the C code for OFFSET($offset). Called by goto_offset().
expr_pop()
Returns the C code for POP(). Called by goto_offset().
access_arg($type, $value, $op)
Returns the C code for the specified op argument type (see Parrot::OpTrans) and value. $op is an instance of Parrot::Op.
restart_offset($offset)
Returns the C code for restart OFFSET($offset).
restart_address($address)
Returns the C code for restart ADDRESS($address).
<<lessDESCRIPTION
Parrot::OpTrans::C inherits from Parrot::OpTrans to provide a function-based (slow or fast core) run loop.
Instance Methods
core_type()
Returns PARROT_FUNCTION_CORE.
core_prefix()
Returns an empty string.
defines()
Returns the C #define macros for register access etc.
gen_goto($where)
Reimplements the superclass method so that $where is suitably cast.
expr_address($address)
Returns the C code for ADDRESS($address). Called by goto_address().
expr_offset($offset)
Returns the C code for OFFSET($offset). Called by goto_offset().
expr_pop()
Returns the C code for POP(). Called by goto_offset().
access_arg($type, $value, $op)
Returns the C code for the specified op argument type (see Parrot::OpTrans) and value. $op is an instance of Parrot::Op.
restart_offset($offset)
Returns the C code for restart OFFSET($offset).
restart_address($address)
Returns the C code for restart ADDRESS($address).
Download (3.1MB)
Added: 2006-07-05 License: GPL (GNU General Public License) Price:
1206 downloads
Array::Utils 0.3
Array::Utils module contains small utils for array manipulation. more>>
Array::Utils module contains small utils for array manipulation.
SYNOPSIS
use Array::Utils qw(:all);
my @a = qw( a b c d );
my @b = qw( c d e f );
# symmetric difference
my @diff = array_diff(@a, @b);
# intersection
my @isect = intersect(@a, @b);
# unique union
my @unique = unique(@a, @b);
# check if arrays contain same members
if ( !array_diff(@a, @b) ) {
# do something
}
FUNCTIONS
unique
Returns an array of unique items in the arguments list.
intersect
Returns an intersection of two arrays passed as arguments.
array_diff
Return symmetric difference of two arrays passed as arguments
<<lessSYNOPSIS
use Array::Utils qw(:all);
my @a = qw( a b c d );
my @b = qw( c d e f );
# symmetric difference
my @diff = array_diff(@a, @b);
# intersection
my @isect = intersect(@a, @b);
# unique union
my @unique = unique(@a, @b);
# check if arrays contain same members
if ( !array_diff(@a, @b) ) {
# do something
}
FUNCTIONS
unique
Returns an array of unique items in the arguments list.
intersect
Returns an intersection of two arrays passed as arguments.
array_diff
Return symmetric difference of two arrays passed as arguments
Download (0.002MB)
Added: 2007-07-17 License: Perl Artistic License Price:
829 downloads
Set::IntSpan::Island 0.03
Set::IntSpan::Island is a Perl extension for Set::IntSpan to handle islands and covers. more>>
Set::IntSpan::Island is a Perl extension for Set::IntSpan to handle islands and covers.
SYNOPSIS
use Set::IntSpan::Island
# inherits normal behaviour from Set::IntSpan
$set = Set::IntSpan::Island->new( $set_spec );
# special two-value input creates a range a-b
$set = Set::IntSpan::Island->new( $a,$b );
# equivalent to $set->cardinality($another_set)->size;
if ($set->overlap( $another_set )) { ... }
# negative if overlap, positive if no overlap
$distance = $set->distance( $another_set );
# remove islands shorter than $minlength
$set = $set->remove_short( $minlength );
# fill holes up to $maxholesize
$set = $set->fill( $maxholesize );
# return a set composed of islands of $set that overlap $another_set
$set = $set->find_island( $another_set );
# return a set comopsed of the nearest non-overlapping island(s) to $another_set
$set = $set->nearest_island( $another_set );
# construct a list of covers by exhaustively intersecting all sets
@covers = Set::IntSpan::Island->extract_cover( { id1=>$set1, id2=>set2, ... } );
for $cover (@covers) {
($coverset,@ids) = ($cover->[0], @{$cover->[1]});
print "cover",$coverset->run_list,"contains sets",join(",",@ids);
}
This module extends the Set::IntSpan module by Steve McDougall. It implementing methods that are specific to islands and covers. Set::IntSpan::Island inherits from Set::IntSpan.
Terminology
An integer set, as represented by Set::IntSpan, is a collection of islands (or spans) on the integer line
...-----xxxx----xxxxxxxx---xxxxxxxx---xx---x----....
Islands are disjoint and contiguous, by definition, and may be represented by their own Set::IntSpan object. Regions not in the set that fall between adjacent spans are termed holes. For example, the integer set above is composed of 5 islands and 4 holes. The two infinite regions on either side of the set are not counted as holes within the context of this module.
METHODS
$set = Set::IntSpan::Island->new( $set_spec )
Constructs a set using the set specification as supported by Set::IntSpan.
$set = Set::IntSpan::Island->new( $a, $b )
Extension to Set::IntSpan new method, this double-argument version creates a set formed by the range a-b. This is equivalent to
$set = Set::IntSpan::Island->new("$a-$b")
but permits initialization from a list instead of a string.
$set_copy = $set->duplicate()
Creates a copy of $set.
$overlap_amount = $set->overlap( $another_set );
Returns the size of intersection of two sets. Equivalent to
$set->intersect( $another_set )->size;
$d = $set->distance( $another_set )
Returns the distance between sets, measured as follows. If the sets overlap, then the distance is negative and given by
$d = - $set->overlap( $another_set )
If the sets do not overlap, $d is positive and given by the distance on the integer line between the two closest islands of the sets.
$d = $set->sets()
Returns all spans in $set as Set::IntSpan::Island objects. This method overrides the sets method in Set::IntSpan in order to return sets as Set::IntSpan::Island objects.
$set = $set->excise( $minlength )
Removes all islands within $set smaller than $minlength.
$set = $set->fill( $maxlength )
Fills in all holes in $set smaller than $maxlength.
$set = $set->find_islands( $integer )
Returns a set containing the island in $set containing $integer. If $integer is not in $set, an empty set is returned.
$set = $set->find_islands( $another_set )
Returns a set containing all islands in $set intersecting $another_set. If $set and $another_set have an empty intersection, an empty set is returned.
$set = $set->nearest_island( $integer )
Returns the nearest island(s) in $set that contains, but does not overlap with, $integer. If $integer lies exactly between two islands, then the returned set contains these two islands.
$set = $set->nearest_island( $another_set );
Returns the nearest island(s) in $set that intersects, but does not overlap with, $another_set. If $another_set lies exactly between two islands, then the returned set contains these two islands.
$cover_data = Set::IntSpan::Island->extract_covers( $set_hash_ref )
Given a $set_hash reference
{ id1=>$set1, id2=>$set2, ..., idn=>$setn}
where $setj is a finite Set::IntSpan::Island object and idj is a unique key, extract_covers performs an exhaustive intersection of all sets and returns a list of all covers and set memberships. For example, given the id/runlist combination
a 10-15
b 12
c 14-20
d 25
The covers are
10-11 a
12 a b
13 a
14-15 a c
16-20 c
21-24 -
25 d
The cover data is returned as an array reference and its structure is
[ [ $cover_set1, [ id11, id12, id13, ... ] ],
[ $cover_set2, [ id21, id22, id23, ... ] ],
...
]
If a cover contains no elements, then its entry is
[ $cover_set, [ ] ]
$island = $set->num_islands
Returns the number of islands in the set.
$island = $set->at_island( $island_index )
Returns the island indexed by $island_index. Islands are 0-indexed. For a set with N islands, the first island (ordered left-to-right) has index 0 and the last island has index N-1.
If $island_index is negative, counting is done back from the last island (c.f. negative indexes of Perl arrays).
$island = $set->first_island
Returns the first island of the set as a Set::IntSpan::Island object. As a side-effect, sets the iterator to the first island.
If the set is empty, returns undef.
$island = $set->last_island
Returns the last island of the set as a Set::IntSpan::Island object. As a side-effect, sets the iterator to the last island.
If the set is empty, returns undef.
$island = $set->next_island
Advances the iterator forward by one island, and returns the next island. If the iterator is undefined (e.g. not previously set by first()), the first island is returned.
Returns undef if the set is empty or if no more islands are available.
$island = $set->prev_island
Reverses the iterator backward by one island, and returns the previous island. If the iterator is undefined (e.g. not previously set by last()), the last island is returned.
Returns undef if the set is empty or if no more islands are available.
$island = $set->current_island
Returns the island at the current iterator position.
Returns undef if the set is empty or if the iterator is not defined.
<<lessSYNOPSIS
use Set::IntSpan::Island
# inherits normal behaviour from Set::IntSpan
$set = Set::IntSpan::Island->new( $set_spec );
# special two-value input creates a range a-b
$set = Set::IntSpan::Island->new( $a,$b );
# equivalent to $set->cardinality($another_set)->size;
if ($set->overlap( $another_set )) { ... }
# negative if overlap, positive if no overlap
$distance = $set->distance( $another_set );
# remove islands shorter than $minlength
$set = $set->remove_short( $minlength );
# fill holes up to $maxholesize
$set = $set->fill( $maxholesize );
# return a set composed of islands of $set that overlap $another_set
$set = $set->find_island( $another_set );
# return a set comopsed of the nearest non-overlapping island(s) to $another_set
$set = $set->nearest_island( $another_set );
# construct a list of covers by exhaustively intersecting all sets
@covers = Set::IntSpan::Island->extract_cover( { id1=>$set1, id2=>set2, ... } );
for $cover (@covers) {
($coverset,@ids) = ($cover->[0], @{$cover->[1]});
print "cover",$coverset->run_list,"contains sets",join(",",@ids);
}
This module extends the Set::IntSpan module by Steve McDougall. It implementing methods that are specific to islands and covers. Set::IntSpan::Island inherits from Set::IntSpan.
Terminology
An integer set, as represented by Set::IntSpan, is a collection of islands (or spans) on the integer line
...-----xxxx----xxxxxxxx---xxxxxxxx---xx---x----....
Islands are disjoint and contiguous, by definition, and may be represented by their own Set::IntSpan object. Regions not in the set that fall between adjacent spans are termed holes. For example, the integer set above is composed of 5 islands and 4 holes. The two infinite regions on either side of the set are not counted as holes within the context of this module.
METHODS
$set = Set::IntSpan::Island->new( $set_spec )
Constructs a set using the set specification as supported by Set::IntSpan.
$set = Set::IntSpan::Island->new( $a, $b )
Extension to Set::IntSpan new method, this double-argument version creates a set formed by the range a-b. This is equivalent to
$set = Set::IntSpan::Island->new("$a-$b")
but permits initialization from a list instead of a string.
$set_copy = $set->duplicate()
Creates a copy of $set.
$overlap_amount = $set->overlap( $another_set );
Returns the size of intersection of two sets. Equivalent to
$set->intersect( $another_set )->size;
$d = $set->distance( $another_set )
Returns the distance between sets, measured as follows. If the sets overlap, then the distance is negative and given by
$d = - $set->overlap( $another_set )
If the sets do not overlap, $d is positive and given by the distance on the integer line between the two closest islands of the sets.
$d = $set->sets()
Returns all spans in $set as Set::IntSpan::Island objects. This method overrides the sets method in Set::IntSpan in order to return sets as Set::IntSpan::Island objects.
$set = $set->excise( $minlength )
Removes all islands within $set smaller than $minlength.
$set = $set->fill( $maxlength )
Fills in all holes in $set smaller than $maxlength.
$set = $set->find_islands( $integer )
Returns a set containing the island in $set containing $integer. If $integer is not in $set, an empty set is returned.
$set = $set->find_islands( $another_set )
Returns a set containing all islands in $set intersecting $another_set. If $set and $another_set have an empty intersection, an empty set is returned.
$set = $set->nearest_island( $integer )
Returns the nearest island(s) in $set that contains, but does not overlap with, $integer. If $integer lies exactly between two islands, then the returned set contains these two islands.
$set = $set->nearest_island( $another_set );
Returns the nearest island(s) in $set that intersects, but does not overlap with, $another_set. If $another_set lies exactly between two islands, then the returned set contains these two islands.
$cover_data = Set::IntSpan::Island->extract_covers( $set_hash_ref )
Given a $set_hash reference
{ id1=>$set1, id2=>$set2, ..., idn=>$setn}
where $setj is a finite Set::IntSpan::Island object and idj is a unique key, extract_covers performs an exhaustive intersection of all sets and returns a list of all covers and set memberships. For example, given the id/runlist combination
a 10-15
b 12
c 14-20
d 25
The covers are
10-11 a
12 a b
13 a
14-15 a c
16-20 c
21-24 -
25 d
The cover data is returned as an array reference and its structure is
[ [ $cover_set1, [ id11, id12, id13, ... ] ],
[ $cover_set2, [ id21, id22, id23, ... ] ],
...
]
If a cover contains no elements, then its entry is
[ $cover_set, [ ] ]
$island = $set->num_islands
Returns the number of islands in the set.
$island = $set->at_island( $island_index )
Returns the island indexed by $island_index. Islands are 0-indexed. For a set with N islands, the first island (ordered left-to-right) has index 0 and the last island has index N-1.
If $island_index is negative, counting is done back from the last island (c.f. negative indexes of Perl arrays).
$island = $set->first_island
Returns the first island of the set as a Set::IntSpan::Island object. As a side-effect, sets the iterator to the first island.
If the set is empty, returns undef.
$island = $set->last_island
Returns the last island of the set as a Set::IntSpan::Island object. As a side-effect, sets the iterator to the last island.
If the set is empty, returns undef.
$island = $set->next_island
Advances the iterator forward by one island, and returns the next island. If the iterator is undefined (e.g. not previously set by first()), the first island is returned.
Returns undef if the set is empty or if no more islands are available.
$island = $set->prev_island
Reverses the iterator backward by one island, and returns the previous island. If the iterator is undefined (e.g. not previously set by last()), the last island is returned.
Returns undef if the set is empty or if no more islands are available.
$island = $set->current_island
Returns the island at the current iterator position.
Returns undef if the set is empty or if the iterator is not defined.
Download (0.009MB)
Added: 2007-07-23 License: Perl Artistic License Price:
824 downloads
Mac::iTunes::Playlist 0.86
Mac::iTunes::Playlist is a Perl module for iTunes playlists. more>>
Mac::iTunes::Playlist is a Perl module for iTunes playlists.
SYNOPSIS
use Mac::iTunes::Playlist;
my $playlist = Mac::iTunes::Playlist->new( @items );
METHODS
new( TITLE, ARRAYREF )
new_from_directory( TITLE, DIRECTORY )
Create a playlist from all of the MP3 files in the named directory.
title
Returns the title of the playlist.
items
In list context, returns a list of the items in the playlist.
In scalar context, returns the number of items in the playlist.
next_item
Not implemented
previous_item
Not implemented
add_item( OBJECT )
Adds the Mac::iTunes::Item object to the playlist.
Returns undef or the empty list if the argument is not a Mac::iTunes::Item object.
delete_item( INDEX )
Deletes the item at index INDEX (counting from zero).
Returns false is the INDEX is greater than the index of the last item. Returns true otherwise.
merge( PLAYLIST )
Adds the items in PLAYLIST to the current playlist and returns the number of items added.
Returns undefined (or the empty list) if the argument is not the right sort of object. Returns 0 if no items were added (which might not be an error).
This method does a deep copy of the Items object. Identical items show up as different objects in each playlist so that the playlists do not refer to each other.
random_item
In scalar context, returns a random item from the playlist.
In list context, returns the item, the index of the item, and the total count of items.
Returns false or the empty list if the playlist has no items.
copy
Return a deep copy of the playlist. The returned object will not refer (as in, point to the same data) as the original object.
Publisher
publish( FORMAT [, FIELDS_REF [, ORDER_REF ] ] )
Output the playlist in some format.
Not implemented.
<<lessSYNOPSIS
use Mac::iTunes::Playlist;
my $playlist = Mac::iTunes::Playlist->new( @items );
METHODS
new( TITLE, ARRAYREF )
new_from_directory( TITLE, DIRECTORY )
Create a playlist from all of the MP3 files in the named directory.
title
Returns the title of the playlist.
items
In list context, returns a list of the items in the playlist.
In scalar context, returns the number of items in the playlist.
next_item
Not implemented
previous_item
Not implemented
add_item( OBJECT )
Adds the Mac::iTunes::Item object to the playlist.
Returns undef or the empty list if the argument is not a Mac::iTunes::Item object.
delete_item( INDEX )
Deletes the item at index INDEX (counting from zero).
Returns false is the INDEX is greater than the index of the last item. Returns true otherwise.
merge( PLAYLIST )
Adds the items in PLAYLIST to the current playlist and returns the number of items added.
Returns undefined (or the empty list) if the argument is not the right sort of object. Returns 0 if no items were added (which might not be an error).
This method does a deep copy of the Items object. Identical items show up as different objects in each playlist so that the playlists do not refer to each other.
random_item
In scalar context, returns a random item from the playlist.
In list context, returns the item, the index of the item, and the total count of items.
Returns false or the empty list if the playlist has no items.
copy
Return a deep copy of the playlist. The returned object will not refer (as in, point to the same data) as the original object.
Publisher
publish( FORMAT [, FIELDS_REF [, ORDER_REF ] ] )
Output the playlist in some format.
Not implemented.
Download (0.11MB)
Added: 2006-11-15 License: Perl Artistic License Price:
1077 downloads
Bio::NEXUS::CodonsBlock 0.67
Bio::NEXUS::CodonsBlock is a Perl module that represents CODONS block in NEXUS file. more>>
Bio::NEXUS::CodonsBlock is a Perl module that represents CODONS block in NEXUS file.
METHODS
new
Title : new
Usage : block_object = new Bio::NEXUS::CodonsBlock();
Function: Creates a new Bio::NEXUS::CodonsBlock object
Returns : Bio::NEXUS::CodonsBlock object
Args :
<<lessMETHODS
new
Title : new
Usage : block_object = new Bio::NEXUS::CodonsBlock();
Function: Creates a new Bio::NEXUS::CodonsBlock object
Returns : Bio::NEXUS::CodonsBlock object
Args :
Download (0.15MB)
Added: 2006-12-21 License: Perl Artistic License Price:
1038 downloads
Yahoo::Marketing::ForecastKeywordResponse 0.08
Yahoo::Marketing::ForecastKeywordResponse is an object to returns forecasted results for a set of keywords. more>>
Yahoo::Marketing::ForecastKeywordResponse is an object to returns forecasted results for a set of keywords.
SYNOPSIS
See http://ysm.techportal.searchmarketing.yahoo.com/docs/reference/dataObjects.asp for documentation of the various data objects.
new
Creates a new instance
METHODS
get/set methods
customizedResponseByAdGroup
defaultResponseByAdGroup
landscapeByAdGroup
get (read only) methods
<<lessSYNOPSIS
See http://ysm.techportal.searchmarketing.yahoo.com/docs/reference/dataObjects.asp for documentation of the various data objects.
new
Creates a new instance
METHODS
get/set methods
customizedResponseByAdGroup
defaultResponseByAdGroup
landscapeByAdGroup
get (read only) methods
Download (0.066MB)
Added: 2006-12-14 License: Perl Artistic License Price:
1044 downloads
Net::Delicious::Iterator 1.01
Net::Delicious::Iterator is an iterator class for Net::Delicious thingies. more>>
Net::Delicious::Iterator is an iterator class for Net::Delicious thingies.
SYNOPSIS
use Net::Delicious::Iterator;
my @dates = ({...},{...});
my $it = Net::Delicious::Iterator->new("Date",@dates);
while (my $d = $it->next()) {
# Do stuff with $d here
}
NOTES
It isnt really expected that you will instantiate these objects outside of Net::Delicious itself.
PACKAGE METHODS
__PACKAGE__->new($foreign_class,@data)
Returns a Net::Delicious::Iterator object. Woot!
$it->count()
Return the number of available thingies.
$it->next()
Returns the next object in the list of available thingies. Woot!
<<lessSYNOPSIS
use Net::Delicious::Iterator;
my @dates = ({...},{...});
my $it = Net::Delicious::Iterator->new("Date",@dates);
while (my $d = $it->next()) {
# Do stuff with $d here
}
NOTES
It isnt really expected that you will instantiate these objects outside of Net::Delicious itself.
PACKAGE METHODS
__PACKAGE__->new($foreign_class,@data)
Returns a Net::Delicious::Iterator object. Woot!
$it->count()
Return the number of available thingies.
$it->next()
Returns the next object in the list of available thingies. Woot!
Download (0.018MB)
Added: 2006-07-27 License: Perl Artistic License Price:
1184 downloads
Color::Object 0.1_02
Color::Object is a OO-Color Module. more>>
Color::Object is a OO-Color Module.
A module for manipulation Colors within RGB, HSV and HSL color-spaces for usage within PDF-Documents especially with the Text::PDF::API modules.
SYNOPSIS
use Color::Object;
$cl = Color::Object->new;
$cl = Color::Object->newRGB($r,$g,$b);
$cl = Color::Object->newHSV($h,$s,$v);
$cl = Color::Object->newHSL($h,$s,$l);
$cl->setRGB($r,$g,$b);
$cl->addBrightness($br);
($h,$s,$l) = $cl->asHSL;
METHODS
Color::Object->new
Color::Object->newRGB $r, $g, $b
Color::Object->newHSV $h, $s, $v
Color::Object->newHSL $h, $s, $l
Color::Object->newGrey $grey
( $r, $g, $b ) = $cl->asRGB
Returns $cls rgb values. Range [0 .. 1].
( $h, $s, $v ) = $cl->asHSV
Returns $cls hsv values. Ranges h [0 .. 360], s/v [0 .. 1].
( $h, $s, $l ) = $cl->asHSL
Returns $cls hsl values. Ranges h [0 .. 360], s/l [0 .. 1].
$grey = $cl->asGrey
$grey = $cl->asGrey2
Returns $cls grey value. Range [0 .. 1]. Functions 2 returns the geometric mean of the corresponding RGB values.
( $c, $m, $y )= $cl->asCMY
Returns $cls cmy values. Range [0 .. 1].
( $c, $m, $y, $k )= $cl->asCMYK
( $c, $m, $y, $k )= $cl->asCMYK2
( $c, $m, $y, $k )= $cl->asCMYK3
Returns $cls cmyk values. Range [0 .. 1]. Function 2 returns a 25% lighter color-equivalent. Function 3 returns a 25% lighter color-equivalent.
$hex = $cl->asHex
Returns $cls rgb values as 6 hex-digits.
$cl->setRGB $r, $g, $b
Sets the $cls rgb values. Valid range [0 .. 1].
$cl->setHSV $h, $s, $v
Sets the $cls hsv values. Valid ranges: h [0..360], s/v [0..1].
$cl->setHSL $h, $s, $l
Sets the $cls hsl values. Valid ranges: h [0..360], s/l [0..1].
$cl->setGrey $grey
Sets the $cls grey value. Valid range [0 .. 1].
$cl->setHex $hex
Sets the $cls rgb values using 6 hex-nibbles.
$cl->addSaturation $saturation
Adds to the $cls saturation in the HSV model. Valid range [-1 .. 1].
$cl->setSaturation $saturation
Sets the $cls saturation in the HSV model. Valid range [0 .. 1].
$cl->rotHue $degrees
Rotates the $cls hue in the HSV/L model. Valid range [-360 .. 360].
$cl->setHue $hue
Sets the $cls hue in the HSV/L model. Valid range [0 .. 360].
$cl->addBrightness $brightness
Adds to the $cls brightness in the HSV model. Valid range [-1 .. 1].
$cl->setBrightness $brightness
Sets the $cls brightness in the HSV model. Valid range [0 .. 1].
$cl->addLightness $lightness
Adds to the $cls lightness in the HSL model. Valid range [-1 .. 1].
$cl->setLightness $lightness
Sets the $cls lightness in the HSL model. Valid range [0 .. 1].
<<lessA module for manipulation Colors within RGB, HSV and HSL color-spaces for usage within PDF-Documents especially with the Text::PDF::API modules.
SYNOPSIS
use Color::Object;
$cl = Color::Object->new;
$cl = Color::Object->newRGB($r,$g,$b);
$cl = Color::Object->newHSV($h,$s,$v);
$cl = Color::Object->newHSL($h,$s,$l);
$cl->setRGB($r,$g,$b);
$cl->addBrightness($br);
($h,$s,$l) = $cl->asHSL;
METHODS
Color::Object->new
Color::Object->newRGB $r, $g, $b
Color::Object->newHSV $h, $s, $v
Color::Object->newHSL $h, $s, $l
Color::Object->newGrey $grey
( $r, $g, $b ) = $cl->asRGB
Returns $cls rgb values. Range [0 .. 1].
( $h, $s, $v ) = $cl->asHSV
Returns $cls hsv values. Ranges h [0 .. 360], s/v [0 .. 1].
( $h, $s, $l ) = $cl->asHSL
Returns $cls hsl values. Ranges h [0 .. 360], s/l [0 .. 1].
$grey = $cl->asGrey
$grey = $cl->asGrey2
Returns $cls grey value. Range [0 .. 1]. Functions 2 returns the geometric mean of the corresponding RGB values.
( $c, $m, $y )= $cl->asCMY
Returns $cls cmy values. Range [0 .. 1].
( $c, $m, $y, $k )= $cl->asCMYK
( $c, $m, $y, $k )= $cl->asCMYK2
( $c, $m, $y, $k )= $cl->asCMYK3
Returns $cls cmyk values. Range [0 .. 1]. Function 2 returns a 25% lighter color-equivalent. Function 3 returns a 25% lighter color-equivalent.
$hex = $cl->asHex
Returns $cls rgb values as 6 hex-digits.
$cl->setRGB $r, $g, $b
Sets the $cls rgb values. Valid range [0 .. 1].
$cl->setHSV $h, $s, $v
Sets the $cls hsv values. Valid ranges: h [0..360], s/v [0..1].
$cl->setHSL $h, $s, $l
Sets the $cls hsl values. Valid ranges: h [0..360], s/l [0..1].
$cl->setGrey $grey
Sets the $cls grey value. Valid range [0 .. 1].
$cl->setHex $hex
Sets the $cls rgb values using 6 hex-nibbles.
$cl->addSaturation $saturation
Adds to the $cls saturation in the HSV model. Valid range [-1 .. 1].
$cl->setSaturation $saturation
Sets the $cls saturation in the HSV model. Valid range [0 .. 1].
$cl->rotHue $degrees
Rotates the $cls hue in the HSV/L model. Valid range [-360 .. 360].
$cl->setHue $hue
Sets the $cls hue in the HSV/L model. Valid range [0 .. 360].
$cl->addBrightness $brightness
Adds to the $cls brightness in the HSV model. Valid range [-1 .. 1].
$cl->setBrightness $brightness
Sets the $cls brightness in the HSV model. Valid range [0 .. 1].
$cl->addLightness $lightness
Adds to the $cls lightness in the HSL model. Valid range [-1 .. 1].
$cl->setLightness $lightness
Sets the $cls lightness in the HSL model. Valid range [0 .. 1].
Download (0.003MB)
Added: 2007-07-31 License: Perl Artistic License Price:
815 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above returns search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed