Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.339.930 Times

Devel::Constants 1.00

  Date Added: November 24, 2010  |  Visits: 682

Devel::Constants

Report Broken Link
Printer Friendly Version


Product Homepage
Download (91 downloads)



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";.

Requirements: No special requirements
Platforms: Linux
Keyword: Constant Constants Develconstants Flag Libraries Module Netpacket Package Perl Perl Module Programming Tcp
Users rating: 0/10

License: Freeware Size: 6.14 KB
USER REVIEWS
More Reviews or Write Review


DEVEL::CONSTANTS RELATED
Libraries  -  Etk::Constants 0.05
Etk::Constants is a Perl module with costants to use with Etk. SYNOPSIS use Etk::Constants qw/ButtonsOk ButtonsClose/; # use Etk::Constants qw/:messagedialog/; # use Etk::Constants qw/:all/; This module contains constants to use while...
51.2 KB  
Development Editors  -  IDAutomation Java Barcode Package for Mac OS 9.11
The JavaBeans, Applets, Servlets and Class Libraries in this package may be used on any platform with a Java Virtual Machine, including Windows, Linux, MacOS, Unix, Solaris, HP/UX, AS/400 and OS/390 to integrate automated barcoding in Java...
2.2 MB  
Libraries  -  Chilkat Class Libraries for Java 9.2.1
The full suite of Chilkat components & libraries are now available for the Java programming language. Commercially licensed components include: Email (POP3 / SMTP) IMAP Zip, GZip, and Unix Compress Encryption MIME and S/MIME FTP HTTP MHT...
 
Libraries  -  Astro::Constants 0.09
Astro::Constants is a Perl module that contains physical constants for use in Astronomy. SYNOPSIS use Astro::Constants::CGS qw(:long); print "The Schwarzschild radius of the sun is ", 2 * GRAVITATIONAL * SOLAR_MASS / LIGHT_SPEED ** 2, "...
12.29 KB  
Libraries  -  Template::Plugin::Java::Constants 0.4
Template::Plugin::Java::Constants is a Perl module with constants for the Java Template plugin modules. SYNOPSIS use Template::Plugin::Java::Constants qw/:regex/; use Template::Plugin::Java::Constants qw/:boolean/; use...
18.43 KB  
Libraries  -  AutoSplit 5.8.8
AutoSplit is a Perl module that can split a package for autoloading. SYNOPSIS autosplit($file, $dir, $keep, $check, $modtime); autosplit_lib_modules(@modules); This function will split up your program into files that the AutoLoader module...
12.2 MB  
Libraries  -  Video::Info::MPEG::Constants 0.993
Video::Info::MPEG::Constants is a suite of modules to probe video files for various attributes. Previous versions of Video::Info depended on external modules, such as RIFF::Info and ASF::Info. This is no longer the case, you dont need to install...
634.88 KB  
Modules  -  Flag Friend 7.x-1.0-alpha7
Flag Friend aims to be a lightweight friending module utilizing the excellent Flag module's API.Flag Friend 1.x implements a default "friend" flag and is limited to one type of relationship.Flag Friend 2.x branch will support an arbitrary number...
20.48 KB  
Libraries  -  ex::constant::vars 0.01
ex::constant::vars is a Perl pragma to create readonly variables. SYNOPSIS Using the tie() interface: use ex::constant::vars; tie my $pi, ex::constant::vars, 4 * atan2( 1, 1 ); tie my @family, ex::constant::vars, qw( John Jane ); tie my...
4.1 KB  
Libraries  -  Apache::PAR::tutorial 0.30
Apache::PAR::tutorial is a Perl module with information on getting Apache::PAR up and running. Apache::PAR is a framework for including Perl ARchive files in a mod_perl (1.x or 2.x) environment. It allows an author to package up a web...
25.6 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB