Devel::Constants 1.00
Sponsored Links
Devel::Constants 1.00 Ranking & Summary
File size:
0.006 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
906
Date added:
2007-05-01
Publisher:
chromatic
Devel::Constants 1.00 description
Devel::Constants is a Perl module that translates constants back to named symbols.
SYNOPSIS
# must precede use constant
use Devel::Constants flag_to_names;
use constant A => 1;
use constant B => 2;
use constant C => 4;
my $flag = A | B;
print "Flag is: ", join( and , flag_to_names($flag) ), "n";
Declaring constants is very convenient for writing programs, but as Perl often inlines them, retrieving their symbolic names can be tricky. This worse with lowlevel modules that use constants for bit-twiddling.
Devel::Constants makes this much more manageable.
It silently wraps around the constant module, intercepting all constant declarations. It builds a hash, associating the values to their names, from which you can retrieve their names as necessary.
Note that you must use Devel::Constants before constant, or the magic will not work and you will be very disappointed. This is very important, and if you ignore this warning, the authors will feel free to laugh at you (at least a little.
By default, Devel::Constants only intercept constant declarations within the same package that used the module. Also by default, it stores the constants for a package within a private (read, otherwise inaccessible) variable. You can override both of these.
Passing the package flag to Devel::Constants with a valid package name will make the module intercept all constants subsequently declared within that package. For example, in the main package you might say:
use Devel::Constants package => NetPacket::TCP;
use NetPacket::TCP;
All of the TCP flags declared within NetPacket::TCP are now available.
It is also possible to pass in a hash reference in which to store the constant values and names:
my %constant_map;
use Devel::Constants %constant_map;
use constant NAME => 1;
use constant RANK => 2;
use constant SERIAL => 4;
print join( , values %constant_map), "n";
SYNOPSIS
# must precede use constant
use Devel::Constants flag_to_names;
use constant A => 1;
use constant B => 2;
use constant C => 4;
my $flag = A | B;
print "Flag is: ", join( and , flag_to_names($flag) ), "n";
Declaring constants is very convenient for writing programs, but as Perl often inlines them, retrieving their symbolic names can be tricky. This worse with lowlevel modules that use constants for bit-twiddling.
Devel::Constants makes this much more manageable.
It silently wraps around the constant module, intercepting all constant declarations. It builds a hash, associating the values to their names, from which you can retrieve their names as necessary.
Note that you must use Devel::Constants before constant, or the magic will not work and you will be very disappointed. This is very important, and if you ignore this warning, the authors will feel free to laugh at you (at least a little.
By default, Devel::Constants only intercept constant declarations within the same package that used the module. Also by default, it stores the constants for a package within a private (read, otherwise inaccessible) variable. You can override both of these.
Passing the package flag to Devel::Constants with a valid package name will make the module intercept all constants subsequently declared within that package. For example, in the main package you might say:
use Devel::Constants package => NetPacket::TCP;
use NetPacket::TCP;
All of the TCP flags declared within NetPacket::TCP are now available.
It is also possible to pass in a hash reference in which to store the constant values and names:
my %constant_map;
use Devel::Constants %constant_map;
use constant NAME => 1;
use constant RANK => 2;
use constant SERIAL => 4;
print join( , values %constant_map), "n";
Devel::Constants 1.00 Screenshot
Devel::Constants 1.00 Keywords
Constants 1.00
TCP
NetPacket
Perl module
back to
constant
constants
package
module
flag
Perl
Devel::Constants
DevelConstants
Devel::Constants 1.00
Libraries
Programming
Bookmark Devel::Constants 1.00
Devel::Constants 1.00 Copyright
WareSeeker periodically updates pricing and software information of Devel::Constants 1.00 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Devel::Constants 1.00 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
constant sorrow
constant contact
java constants
gravitational constant
constant chest tightness
constantine carpet
constant chest tightness from anxiety
yeng constantino
physical constants
man of constant sorrow
constant chatter
constant headache
constants in java
constant chest pressure
constantine the great
vacheron constantin
equilibrium constants
module master
Related Software
Etk::Constants is a Perl module with costants to use with Etk. Free Download
Devel::Pointer is a Perl module that can fiddle around with pointers. Free Download
Devel::TraceMethods is a Perl module for tracing module calls. Free Download
RPM::Constants is a Perl module with groups of RPM-defined symbols. Free Download
C::Scan::Constants Perl module contains slurp constants from specified C header (.h) files. Free Download
Astro::Constants is a Perl module that contains physical constants for use in Astronomy. Free Download
Net::Delicious::Constants::Config are constant variables for Net::Delicious default configs. Free Download
Devel::Command::NewF is a Perl module with the extended f command for the debugger. Free Download
Latest Software
Popular Software
Favourite Software