variable names
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 4626
Variable::Alias 0.01
Variable::Alias is a Perl module created to alias any variable to any other variable. more>>
Variable::Alias is a Perl module created to alias any variable to any other variable.
SYNOPSIS
use Variable::Alias alias;
my $src;
my $a;
our $b;
my @c;
our @d;
alias $src => $a;
alias $a => $b;
alias $b => $c[0];
alias @c => @d;
$src=src;
# All the other variables now have the string
# src in the appropriate places.
There are various ways to alias one variable to another in Perl. The most popular is by assigning to typeglobs. This is quite efective, but only works with globals. Another method is to use a module like Lexical::Alias or Devel::LexAlias, but as their names suggest, these only work with lexicals. Theres no way to alias an element of an array or hash.
Variable::Alias changes all that. It uses a tie to provide One True Way to alias a variable.
Interface
Variable::Alias may export any or all of five functions. If youve used Lexical::Alias, the interface is virtually identical.
alias(VAR, VAR)
alias takes two variables of any type (scalar, array or hash) and aliases them. Make sure they have the sigil you want on the front.
This function is only available in Perl 5.8.0 and later, because the prototype tricks it uses were first implemented in that version.
alias_s(SCALAR, SCALAR)
alias_s takes two scalars and aliases them.
alias_a(ARRAY, ARRAY)
alias_a takes two arrays and aliases them. Note that this is actual arrays, not array elements, although you can alias references in elements, like so:
alias_a(@short, @{$some->sequence->{of}->calls->{thats}[2]{long}});
alias_h(HASH, HASH)
alias_h takes two hashes and aliases them.
alias_r(REF, REF)
alias_r takes two references and aliases them. The referents must be of the same type.
<<lessSYNOPSIS
use Variable::Alias alias;
my $src;
my $a;
our $b;
my @c;
our @d;
alias $src => $a;
alias $a => $b;
alias $b => $c[0];
alias @c => @d;
$src=src;
# All the other variables now have the string
# src in the appropriate places.
There are various ways to alias one variable to another in Perl. The most popular is by assigning to typeglobs. This is quite efective, but only works with globals. Another method is to use a module like Lexical::Alias or Devel::LexAlias, but as their names suggest, these only work with lexicals. Theres no way to alias an element of an array or hash.
Variable::Alias changes all that. It uses a tie to provide One True Way to alias a variable.
Interface
Variable::Alias may export any or all of five functions. If youve used Lexical::Alias, the interface is virtually identical.
alias(VAR, VAR)
alias takes two variables of any type (scalar, array or hash) and aliases them. Make sure they have the sigil you want on the front.
This function is only available in Perl 5.8.0 and later, because the prototype tricks it uses were first implemented in that version.
alias_s(SCALAR, SCALAR)
alias_s takes two scalars and aliases them.
alias_a(ARRAY, ARRAY)
alias_a takes two arrays and aliases them. Note that this is actual arrays, not array elements, although you can alias references in elements, like so:
alias_a(@short, @{$some->sequence->{of}->calls->{thats}[2]{long}});
alias_h(HASH, HASH)
alias_h takes two hashes and aliases them.
alias_r(REF, REF)
alias_r takes two references and aliases them. The referents must be of the same type.
Download (0.003MB)
Added: 2007-05-04 License: Perl Artistic License Price:
903 downloads
Variable Expression Library 1.1
Variable Expression Library is a C++ library that expands variables in text buffers. more>>
libvarexp is a C++ library that allows its users to detach any kind of information from the representation of that information by providing a simple-to-use but powerful text-template mechanism.
Similar mechanisms have been available in tools like sh(1), make(1), or perl(1) forever and have proven to be very useful.
The basic idea is that the relevant information is made available in variables, which the author of the template can than use within the text itself as he or she sees fit.
Consider, for example, a tool that will calculate the monthly financial reports of a small company.
Such a program should only calculate the required values, it should not worry about writing the resulting reports into an HTML file, a CSV file, or whatever format is desired. Instead, it should make the results of the calculation available in the variables "$TURNOVER", "$PROFIT", and "$INCREASE".
Then, using libvarexp, it could load an arbitrary template file and have the actual values inserted at the apropriate positions. Without changing a single line of code, one could generate the monthly report in HTML
<<lessSimilar mechanisms have been available in tools like sh(1), make(1), or perl(1) forever and have proven to be very useful.
The basic idea is that the relevant information is made available in variables, which the author of the template can than use within the text itself as he or she sees fit.
Consider, for example, a tool that will calculate the monthly financial reports of a small company.
Such a program should only calculate the required values, it should not worry about writing the resulting reports into an HTML file, a CSV file, or whatever format is desired. Instead, it should make the results of the calculation available in the variables "$TURNOVER", "$PROFIT", and "$INCREASE".
Then, using libvarexp, it could load an arbitrary template file and have the actual values inserted at the apropriate positions. Without changing a single line of code, one could generate the monthly report in HTML
Download (0.093MB)
Added: 2005-10-06 License: BSD License Price:
1478 downloads
Twisted Names 0.3.0
Twisted Names is both a domain name server as well as a client resolver library. more>>
Twisted Names project is both a domain name server as well as a client resolver library.
Twisted Names comes with an "out of the box" nameserver which can read most BIND-syntax zone files as well as a simple Python-based configuration format.
Twisted Names can act as an authoritative server, perform zone transfers from a master to act as a secondary, act as a caching nameserver, or any combination of these.
Twisted Names client resolver library provides functions to query for all commonly used record types as well as a replacement for the blocking gethostbyname() function provided by the Python stdlib socket module.
Twisted Names is available under the MIT Free Software licence.
Enhancements:
- Errors in the markup used in API documentation have been fixed.
- A bug where the DNS client would sometimes drop a response has been fixed.
- A bug which prevented non-IN lookups from generating malformed queries has been fixed.
<<lessTwisted Names comes with an "out of the box" nameserver which can read most BIND-syntax zone files as well as a simple Python-based configuration format.
Twisted Names can act as an authoritative server, perform zone transfers from a master to act as a secondary, act as a caching nameserver, or any combination of these.
Twisted Names client resolver library provides functions to query for all commonly used record types as well as a replacement for the blocking gethostbyname() function provided by the Python stdlib socket module.
Twisted Names is available under the MIT Free Software licence.
Enhancements:
- Errors in the markup used in API documentation have been fixed.
- A bug where the DNS client would sometimes drop a response has been fixed.
- A bug which prevented non-IN lookups from generating malformed queries has been fixed.
Download (0.028MB)
Added: 2006-05-28 License: MIT/X Consortium License Price:
1246 downloads
Language::Basic::Variable 1.44
Language::Basic::Variable is a Perl module to handle parsing and implementing BASIC variables. more>>
Language::Basic::Variable is a Perl module to handle parsing and implementing BASIC variables.
SYNOPSIS
See Language::Basic for the overview of how the Language::Basic module works. This pod page is more technical.
There are two sorts of variables: Arrays and Scalars. Each of those classes has a subclass for Numeric or String variables.
An Array needs to have full LBV::Scalar objects in it, rather than just having an array of values. The reason is that, for example, you might use ARR(3) as the variable in a FOR loop. Also, the "set" and "value" methods apply to a LBV::Scalar (since you cant set an array to a value (in BASIC) so in order to be handle A(3)=3, A(3) needs to be an LBV::Scalar.
The lookup method looks up a variable in the Array or Scalar lookup table (depending on whether there were parentheses after the variable name). BASIC allows undeclared variables, so if the variable name hasnt been seen before, a new variable is created.
Language::Basic::Variable::Scalar class
This class handles a variable or one cell in an array.
Methods include "value", which gets the variables value, and "set", which sets it.
Language::Basic::Variable::Array class
This class handles a BASIC array. Each cell in the array is a LBV::Scalar object.
Methods include "dimension", which dimensions the array to a given size (or a default size) and get_cell, which returns the LBV::Scalar object in a given array location.
Note that BASIC arrays start from 0!
<<lessSYNOPSIS
See Language::Basic for the overview of how the Language::Basic module works. This pod page is more technical.
There are two sorts of variables: Arrays and Scalars. Each of those classes has a subclass for Numeric or String variables.
An Array needs to have full LBV::Scalar objects in it, rather than just having an array of values. The reason is that, for example, you might use ARR(3) as the variable in a FOR loop. Also, the "set" and "value" methods apply to a LBV::Scalar (since you cant set an array to a value (in BASIC) so in order to be handle A(3)=3, A(3) needs to be an LBV::Scalar.
The lookup method looks up a variable in the Array or Scalar lookup table (depending on whether there were parentheses after the variable name). BASIC allows undeclared variables, so if the variable name hasnt been seen before, a new variable is created.
Language::Basic::Variable::Scalar class
This class handles a variable or one cell in an array.
Methods include "value", which gets the variables value, and "set", which sets it.
Language::Basic::Variable::Array class
This class handles a BASIC array. Each cell in the array is a LBV::Scalar object.
Methods include "dimension", which dimensions the array to a given size (or a default size) and get_cell, which returns the LBV::Scalar object in a given array location.
Note that BASIC arrays start from 0!
Download (0.051MB)
Added: 2006-09-29 License: Perl Artistic License Price:
1121 downloads
Variable::Strongly::Typed 1.1.0
Variable::Strongly::Typed is a Perl module to let some variables be strongly typed. more>>
Variable::Strongly::Typed is a Perl module to let some variables be strongly typed.
SYNOPSIS
use Variable::Strongly::Typed;
my $int :TYPE(int); # must have an int value
my $float :TYPE(float); # must have a float value
my $string :TYPE(string); # must not be a reference
my $file :TYPE(IO::File); # must be an IO::File
my @array_of_ints :TYPE(int); # Each slot must contain
# an int
my %hash_of_floats :TYPE(float); # Each value must be a float
my $int_own_error :TYPE(int, &my_own_error_handler);
# Roll my own error handler
my @array_of_rgb :TYPE(&red_green_blue); # my enumerated type
# For subs!!
sub return_an_int :TYPE(int) {
# .. do some stuff ..
return $something;
}
# ... and later ...
$int = 23; # All is well
$int = howdy!; # This line will croak with a good error message
$float = 3.23; # All is well, nothing to see here
$float = new XML::Parser; # croak!
$array_of_ints[23] = 44; # Groovy
$array_of_ints[12] = yah; # croak!
$hash_of_floats{pi} = 3.14159; # no problem
$hash_of_floats{e} = new IO::File; # croak!
# Return 1 if this val is RED, BLUE, or GREEN
# 0 otherwise
sub red_green_blue {
local $_ = shift;
/A RED z/xms || /A BLUE z/xms || /A GREEN z/xms;
}
$array_of_my_very_own_types[23] = 99; # croak!
$array_of_my_very_own_types[2] = BLUE; # OK!
$int_own_error = lksdklwe; # The sub my_own_error_hanlder
# will be # called with the
# offending value
my $got_it = return_an_int(); # Will croak (or call your error
# function) # if this sub doesnt
# return an int
This modules allow you to strongly type your variables. Also known as the no fun module - it can greatly enhance you codes quality and robustness.
By enforcing types on some (or all) of your variables you will eliminate a large class of careless (& not so careless) errors.
This could also aid an editor or code-browsing tools to verify code correctness without having to execute the script.
<<lessSYNOPSIS
use Variable::Strongly::Typed;
my $int :TYPE(int); # must have an int value
my $float :TYPE(float); # must have a float value
my $string :TYPE(string); # must not be a reference
my $file :TYPE(IO::File); # must be an IO::File
my @array_of_ints :TYPE(int); # Each slot must contain
# an int
my %hash_of_floats :TYPE(float); # Each value must be a float
my $int_own_error :TYPE(int, &my_own_error_handler);
# Roll my own error handler
my @array_of_rgb :TYPE(&red_green_blue); # my enumerated type
# For subs!!
sub return_an_int :TYPE(int) {
# .. do some stuff ..
return $something;
}
# ... and later ...
$int = 23; # All is well
$int = howdy!; # This line will croak with a good error message
$float = 3.23; # All is well, nothing to see here
$float = new XML::Parser; # croak!
$array_of_ints[23] = 44; # Groovy
$array_of_ints[12] = yah; # croak!
$hash_of_floats{pi} = 3.14159; # no problem
$hash_of_floats{e} = new IO::File; # croak!
# Return 1 if this val is RED, BLUE, or GREEN
# 0 otherwise
sub red_green_blue {
local $_ = shift;
/A RED z/xms || /A BLUE z/xms || /A GREEN z/xms;
}
$array_of_my_very_own_types[23] = 99; # croak!
$array_of_my_very_own_types[2] = BLUE; # OK!
$int_own_error = lksdklwe; # The sub my_own_error_hanlder
# will be # called with the
# offending value
my $got_it = return_an_int(); # Will croak (or call your error
# function) # if this sub doesnt
# return an int
This modules allow you to strongly type your variables. Also known as the no fun module - it can greatly enhance you codes quality and robustness.
By enforcing types on some (or all) of your variables you will eliminate a large class of careless (& not so careless) errors.
This could also aid an editor or code-browsing tools to verify code correctness without having to execute the script.
Download (0.010MB)
Added: 2007-01-18 License: Perl Artistic License Price:
1009 downloads
Fortran::Namelist 0.10
Fortran::Namelist is a Perl extension for Fortran namelists. more>>
Fortran::Namelist is a Perl extension for Fortran namelists.
SYNOPSIS
use Fortran::Namelist;
my $nml_file = /home/user/my_namelist.nml;
my $nml=Fortran::Namelist->new( file => $nml_file );
my %new_group = ( group_name => { grp_var1 => some_string, grp_var2 => [ 1 , 2 , 3 ], } );
$nml->set( %group );
$nml->print( file => another_file.nml );
Namelist implements a basic handling of standard fortan namelists. Namelist files are ascii files that allow a fortran program to transfer a group of variables by referencing the name of the group which they belong. Example of a namelist file:
$group_name
vec(2) = 3, 4, 5
c = abc
i = 3
$end
A namelist record starts with the name of the group preceded by $ or by &, followed by a sequence of variables-values with the appropriate value separators ( blanks,tabs,newlines, or any of them with a single comma). the end of the group is indicated by $end or by /.
<<lessSYNOPSIS
use Fortran::Namelist;
my $nml_file = /home/user/my_namelist.nml;
my $nml=Fortran::Namelist->new( file => $nml_file );
my %new_group = ( group_name => { grp_var1 => some_string, grp_var2 => [ 1 , 2 , 3 ], } );
$nml->set( %group );
$nml->print( file => another_file.nml );
Namelist implements a basic handling of standard fortan namelists. Namelist files are ascii files that allow a fortran program to transfer a group of variables by referencing the name of the group which they belong. Example of a namelist file:
$group_name
vec(2) = 3, 4, 5
c = abc
i = 3
$end
A namelist record starts with the name of the group preceded by $ or by &, followed by a sequence of variables-values with the appropriate value separators ( blanks,tabs,newlines, or any of them with a single comma). the end of the group is indicated by $end or by /.
Download (0.008MB)
Added: 2007-04-20 License: Perl Artistic License Price:
921 downloads
MySQL Global User Variables UDF 1.0
MySQL Global User Variables UDF is a MySQL extension to store persistent variables. more>>
MySQL Global User Variables UDF is a MySQL extension to store persistent variables.
This shared library adds simple user functions to MySQL in order to keep persistent shared variables in memory. These variables and their values are available to all clients. Any data can be stored into these persistent variables, including BLOBs. Since updates are atomic and way faster than MEMORY tables, this is an easy and efficient way to handle counters and sequences.
Usage:
Storing a value
An unlimited number of user variables can be created, as long as memory is available.
The GLOBAL_STORE(, ) stores a new shared global variable.
Examples:
mysql> DO GLOBAL_STORE("online_users", 42);
mysql> DO GLOBAL_STORE("secret_key", "pajfUyfnd");
The GLOBAL_STORE() function always returns 1 unless an error occurred.
Fetching a value
Reading the value of a variable is the job of the GLOBAL_GET() function.
The value is returned, or NULL is the variable is undefined.
Example:
mysql> SELECT GLOBAL_GET("online_users;);
42
mysql> SELECT id FROM pxs WHERE secret_key = GLOBAL_GET("secret_key");
1
Atomic increments
A single function call can read the previous value, add an integer (that can be negative), and store the new value into the variable.
The function is GLOBAL_ADD(, ) and the return value is the new value of the variable.
Updates are always atomic, if the old value is 18 and you add 1, you will always get back 19.
Example:
mysql> DO GLOBAL_ADD("online_users", 1);
mysql> SELECT GLOBAL_ADD("online_users", -4);
39
If the value of a variable was a string, the new value is the increment:
mysql> SELECT GLOBAL_ADD("secret_key", 12);
12
Adding a value to an undefined variable returns NULL.
A handy variant is GLOBAL_ADDP(, ). GLOBAL_ADDP() is similar to GLOBAL_ADD() but returns the PREVIOUS value of the variable instead of the new one.
Example:
mysql> DO GLOBAL_SET("xxx", 10);
mysql> SELECT GLOBAL_ADDP("xxx", 1);
10
mysql> SELECT GLOBAL_ADDP("xxx", 1);
11
Installation:
On most systems, compiling and installing the library should be as simple as typing (as root):
make install
The shared library is installed as /usr/local/lib/udf_global_user_variables.so
If the base directory of your MySQL installation is not in /usr/local, just type:
make
and then copy udf_global_user_variables.so to the right location for UDFs on your system (maybe /usr/lib/).
The name of a variable is limited to 256 bytes. If that limit is too low for your specific application, just edit the MAX_NAME_LENGTH variable on top of the .c file and reinstall. Variable names can contain binary characters.
Values are limited to 65536 bytes. If that limit is too low for you, edit the MAX_VALUE_LENGTH variable and reinstall.
<<lessThis shared library adds simple user functions to MySQL in order to keep persistent shared variables in memory. These variables and their values are available to all clients. Any data can be stored into these persistent variables, including BLOBs. Since updates are atomic and way faster than MEMORY tables, this is an easy and efficient way to handle counters and sequences.
Usage:
Storing a value
An unlimited number of user variables can be created, as long as memory is available.
The GLOBAL_STORE(, ) stores a new shared global variable.
Examples:
mysql> DO GLOBAL_STORE("online_users", 42);
mysql> DO GLOBAL_STORE("secret_key", "pajfUyfnd");
The GLOBAL_STORE() function always returns 1 unless an error occurred.
Fetching a value
Reading the value of a variable is the job of the GLOBAL_GET() function.
The value is returned, or NULL is the variable is undefined.
Example:
mysql> SELECT GLOBAL_GET("online_users;);
42
mysql> SELECT id FROM pxs WHERE secret_key = GLOBAL_GET("secret_key");
1
Atomic increments
A single function call can read the previous value, add an integer (that can be negative), and store the new value into the variable.
The function is GLOBAL_ADD(, ) and the return value is the new value of the variable.
Updates are always atomic, if the old value is 18 and you add 1, you will always get back 19.
Example:
mysql> DO GLOBAL_ADD("online_users", 1);
mysql> SELECT GLOBAL_ADD("online_users", -4);
39
If the value of a variable was a string, the new value is the increment:
mysql> SELECT GLOBAL_ADD("secret_key", 12);
12
Adding a value to an undefined variable returns NULL.
A handy variant is GLOBAL_ADDP(, ). GLOBAL_ADDP() is similar to GLOBAL_ADD() but returns the PREVIOUS value of the variable instead of the new one.
Example:
mysql> DO GLOBAL_SET("xxx", 10);
mysql> SELECT GLOBAL_ADDP("xxx", 1);
10
mysql> SELECT GLOBAL_ADDP("xxx", 1);
11
Installation:
On most systems, compiling and installing the library should be as simple as typing (as root):
make install
The shared library is installed as /usr/local/lib/udf_global_user_variables.so
If the base directory of your MySQL installation is not in /usr/local, just type:
make
and then copy udf_global_user_variables.so to the right location for UDFs on your system (maybe /usr/lib/).
The name of a variable is limited to 256 bytes. If that limit is too low for your specific application, just edit the MAX_NAME_LENGTH variable on top of the .c file and reinstall. Variable names can contain binary characters.
Values are limited to 65536 bytes. If that limit is too low for you, edit the MAX_VALUE_LENGTH variable and reinstall.
Download (0.004MB)
Added: 2007-03-19 License: GPL (GNU General Public License) Price:
951 downloads
IdealMySQL 1.1
IdealMySQL is a PHP class that provides an interface for working with MySQL databases. more>>
IdealMySQL is a PHP class that provides an interface for working with MySQL databases.
The project can connect to a database, execute queries on a database, check variable names for validity, and catch errors and email them to the administrator.
All error messages are stored in a text file that can be easily edited, and the look and feel of the error output to the user is controlled by a style sheet.
<<lessThe project can connect to a database, execute queries on a database, check variable names for validity, and catch errors and email them to the administrator.
All error messages are stored in a text file that can be easily edited, and the look and feel of the error output to the user is controlled by a style sheet.
Download (0.005MB)
Added: 2007-06-18 License: GPL (GNU General Public License) Price:
859 downloads
Variable::Strongly::Typed::Array 1.1.0
Variable::Strongly::Typed::Array is a Perl module for strongly typed array. more>>
Variable::Strongly::Typed::Array is a Perl module for strongly typed array.
SYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly
my @array_of_ints :TYPE(int); # Each slot must contain an int
my @array_of_rgb :TYPE(&red_green_blue); # my enumerated type
# ... and later ...
$array_of_ints[23] = 44; # Groovy
$array_of_ints[12] = yah; # croak!
# Return 1 if this val is RED, BLUE, or GREEN
# 0 otherwise
sub red_green_blue {
local $_ = shift;
/A RED z/xms || /A BLUE z/xms || /A GREEN z/xms;
}
$array_of_my_very_own_types[23] = 99; # croak!
$array_of_my_very_own_types[2] = BLUE; # OK!
<<lessSYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly
my @array_of_ints :TYPE(int); # Each slot must contain an int
my @array_of_rgb :TYPE(&red_green_blue); # my enumerated type
# ... and later ...
$array_of_ints[23] = 44; # Groovy
$array_of_ints[12] = yah; # croak!
# Return 1 if this val is RED, BLUE, or GREEN
# 0 otherwise
sub red_green_blue {
local $_ = shift;
/A RED z/xms || /A BLUE z/xms || /A GREEN z/xms;
}
$array_of_my_very_own_types[23] = 99; # croak!
$array_of_my_very_own_types[2] = BLUE; # OK!
Download (0.010MB)
Added: 2007-01-18 License: Perl Artistic License Price:
1009 downloads
Makefile::Parser 0.11
Makefile::Parser is a Simple Parser for Makefiles. more>>
Makefile::Parser is a Simple Parser for Makefiles.
SYNOPSIS
use Makefile::Parser;
$parser = Makefile::Parser->new;
# Equivalent to ->parse(Makefile);
$parser->parse or
die Makefile::Parser->error;
# Get last value assigned to the specified variable CC:
print $parser->var(CC);
# Get all the variable names defined in the Makefile:
@vars = $parser->vars;
print join( , sort @vars);
@roots = $parser->roots; # Get all the "root targets"
print $roots[0]->name;
@tars = $parser->targets; # Get all the targets
$tar = join("n", $tars[0]->commands);
# Get the default target, say, the first target defined in Makefile:
$tar = $parser->target;
$tar = $parser->target(install);
# Get the name of the target, say, install here:
print $tar->name;
# Get the dependencies for the target install:
@depends = $tar->depends;
# Access the shell command used to build the current target.
@cmds = $tar->commands;
# Parse another file using the same Parser object:
$parser->parse(Makefile.old) or
die Makefile::Parser->error;
# Get the target who is specified by variable EXE_FILE
$tar = $parser->target($parser->var(EXE_FILE));
This is a parser for Makefiles. At this very early stage, the parser only supports a limited set of features, so it may not recognize some advanced features provided by certain make tools like GNU make. Its initial purpose is to provide basic support for another module named Makefile::GraphViz, which is aimed to render the building process specified by a Makefile using the amazing GraphViz library. The Make module is not satisfactory for this purpose, so I decided to build one of my own.
<<lessSYNOPSIS
use Makefile::Parser;
$parser = Makefile::Parser->new;
# Equivalent to ->parse(Makefile);
$parser->parse or
die Makefile::Parser->error;
# Get last value assigned to the specified variable CC:
print $parser->var(CC);
# Get all the variable names defined in the Makefile:
@vars = $parser->vars;
print join( , sort @vars);
@roots = $parser->roots; # Get all the "root targets"
print $roots[0]->name;
@tars = $parser->targets; # Get all the targets
$tar = join("n", $tars[0]->commands);
# Get the default target, say, the first target defined in Makefile:
$tar = $parser->target;
$tar = $parser->target(install);
# Get the name of the target, say, install here:
print $tar->name;
# Get the dependencies for the target install:
@depends = $tar->depends;
# Access the shell command used to build the current target.
@cmds = $tar->commands;
# Parse another file using the same Parser object:
$parser->parse(Makefile.old) or
die Makefile::Parser->error;
# Get the target who is specified by variable EXE_FILE
$tar = $parser->target($parser->var(EXE_FILE));
This is a parser for Makefiles. At this very early stage, the parser only supports a limited set of features, so it may not recognize some advanced features provided by certain make tools like GNU make. Its initial purpose is to provide basic support for another module named Makefile::GraphViz, which is aimed to render the building process specified by a Makefile using the amazing GraphViz library. The Make module is not satisfactory for this purpose, so I decided to build one of my own.
Download (0.018MB)
Added: 2006-10-24 License: Perl Artistic License Price:
1098 downloads
Variable::Strongly::Typed::Scalar 1.1.0
Variable::Strongly::Typed::Scalar is Perl module for strongly typed scalar. more>>
Variable::Strongly::Typed::Scalar is Perl module for strongly typed scalar.
SYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly
=head1 DESCRIPTION
<<lessSYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly
=head1 DESCRIPTION
Download (0.010MB)
Added: 2007-01-18 License: Perl Artistic License Price:
1009 downloads
Perl6::Parameters 0.03
Perl6::Parameters is a module with Perl 6-style prototypes with named parameters. more>>
Perl6::Parameters is a module with Perl 6-style prototypes with named parameters.
SYNOPSIS
use Perl6::Parameters;
sub mysub($foo, ARRAY $bar, *%rest) {
...
}
DETAILS
Perl6::Parameters is a Perl module which simulates Perl 6s named parameters. (When I talk about "named parameters" I mean something like the parameters youre used to from C, Java and many other languages--not pass-a-hash-with-the-parameters-in-it things.)
Like most other programming languages, Perl 6 will support subroutines with pre-declared variables the parameters are put into. (Using this will be optional, however.) This goes far beyond the "line-noise prototypes" available in Perl 5, which only allow you to control context and automatically take references to some parameters--lines like my($first, $second)=(@_) will no longer be necessary.
Although Perl 6 will have this, Perl 5 doesnt; this module makes it so that Perl 5 does. It uses some other Perl 6-isms too, notably the names for builtin types and the unary-asterisk notation for flattening a list.
Crafting Parameter Lists
Crafting parameter lists is simple; just declare your subroutine and put the parameters separated by commas or semicolons, in parenthesis. (Using a semicolon signifies that all remaining parameters are optional; this may not be available this way in Perl 6, but Im assuming it is until I hear otherwise.)
Most parameters are just variable names like $foo; however, more sophisticated behavior is possible. There are three ways to achieve this.
The first way is by specifying a type for the variable. Certain types make the actual parameters turn into references to themselves:
ARRAY $foo
This turns an array into a reference to itself and stores the reference into $foo.
HASH $foo
This turns a hash into a reference to itself and stores the reference into $foo.
CODE $foo
This turns a subroutine into a reference to itself and stores the reference into $foo.
SCALAR $foo
This turns a scalar into a reference to itself and stores the reference into $foo.
GLOB $foo
This turns a typeglob into a reference to itself and stores the reference into $foo. Typeglobs will be going away in Perl 6; this type exists in this module so that its useful for general use in Perl 5.
REF $foo
This turns any parameter into a reference to itself and stores it into $foo.
This only works in Perl 5.8. Otherwise, its treated the same as any other unrecognized type name.
AnythingElse $foo
This has no effect in this module; its treated as though youd typed $foo without the AnythingElse.
For example, if a subroutine had the parameters ($foo, HASH $bar, CODE $baz) and was called with ($scalar, %hash, &mysub) the subroutine would get the contents of $scalar, a reference to %hash and a reference to &mysub.
The second way is by supplying an actual array or hash as a parameter name. This requires an array or hash to be passed in for that parameter; it preserves the length of the array or hash.
The final way is only available for the last parameter: if an array or hash is prefixed with an asterisk, that array or hash will be filled with any additional parameters.
<<lessSYNOPSIS
use Perl6::Parameters;
sub mysub($foo, ARRAY $bar, *%rest) {
...
}
DETAILS
Perl6::Parameters is a Perl module which simulates Perl 6s named parameters. (When I talk about "named parameters" I mean something like the parameters youre used to from C, Java and many other languages--not pass-a-hash-with-the-parameters-in-it things.)
Like most other programming languages, Perl 6 will support subroutines with pre-declared variables the parameters are put into. (Using this will be optional, however.) This goes far beyond the "line-noise prototypes" available in Perl 5, which only allow you to control context and automatically take references to some parameters--lines like my($first, $second)=(@_) will no longer be necessary.
Although Perl 6 will have this, Perl 5 doesnt; this module makes it so that Perl 5 does. It uses some other Perl 6-isms too, notably the names for builtin types and the unary-asterisk notation for flattening a list.
Crafting Parameter Lists
Crafting parameter lists is simple; just declare your subroutine and put the parameters separated by commas or semicolons, in parenthesis. (Using a semicolon signifies that all remaining parameters are optional; this may not be available this way in Perl 6, but Im assuming it is until I hear otherwise.)
Most parameters are just variable names like $foo; however, more sophisticated behavior is possible. There are three ways to achieve this.
The first way is by specifying a type for the variable. Certain types make the actual parameters turn into references to themselves:
ARRAY $foo
This turns an array into a reference to itself and stores the reference into $foo.
HASH $foo
This turns a hash into a reference to itself and stores the reference into $foo.
CODE $foo
This turns a subroutine into a reference to itself and stores the reference into $foo.
SCALAR $foo
This turns a scalar into a reference to itself and stores the reference into $foo.
GLOB $foo
This turns a typeglob into a reference to itself and stores the reference into $foo. Typeglobs will be going away in Perl 6; this type exists in this module so that its useful for general use in Perl 5.
REF $foo
This turns any parameter into a reference to itself and stores it into $foo.
This only works in Perl 5.8. Otherwise, its treated the same as any other unrecognized type name.
AnythingElse $foo
This has no effect in this module; its treated as though youd typed $foo without the AnythingElse.
For example, if a subroutine had the parameters ($foo, HASH $bar, CODE $baz) and was called with ($scalar, %hash, &mysub) the subroutine would get the contents of $scalar, a reference to %hash and a reference to &mysub.
The second way is by supplying an actual array or hash as a parameter name. This requires an array or hash to be passed in for that parameter; it preserves the length of the array or hash.
The final way is only available for the last parameter: if an array or hash is prefixed with an asterisk, that array or hash will be filled with any additional parameters.
Download (0.004MB)
Added: 2007-06-22 License: Perl Artistic License Price:
854 downloads
Persistent::Oracle 0.50
Persistent::Oracle is a persistent class implemented using an Oracle database. more>>
Persistent::Oracle is a persistent class implemented using an Oracle database.
SYNOPSIS
use Persistent::Oracle;
use English; # import readable variable names like $EVAL_ERROR
eval { ### in case an exception is thrown ###
### allocate a persistent object ###
my $emp = new Persistent::Oracle(dbi:Oracle:ORCL,
scott, tiger, emp);
### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);
### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};
if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}
ABSTRACT
This is a Persistent class that uses an Oracle database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.
<<lessSYNOPSIS
use Persistent::Oracle;
use English; # import readable variable names like $EVAL_ERROR
eval { ### in case an exception is thrown ###
### allocate a persistent object ###
my $emp = new Persistent::Oracle(dbi:Oracle:ORCL,
scott, tiger, emp);
### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);
### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};
if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}
ABSTRACT
This is a Persistent class that uses an Oracle database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.
Download (0.011MB)
Added: 2007-05-19 License: Perl Artistic License Price:
889 downloads
Variable::Strongly::Typed::Validators 1.1.0
Variable::Strongly::Typed::Validators is Perl module with built-in type validators. more>>
Variable::Strongly::Typed::Validators is Perl module with built-in type validators.
SYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly. This module defines a %conditions hash contained expressions that define the built-in types. If you want to create a new type just pass a CODE ref in your TYPE() attribute rather than modifying this hash.
=head1 DESCRIPTION
DO NOT USE THIS MODULE DIRECTLY!! Its used by Variable::Strongly::Typed to do its magic.
<<lessSYNOPSIS
This class is utilized by Variable::Strongly::Typed - you dont access this directly. This module defines a %conditions hash contained expressions that define the built-in types. If you want to create a new type just pass a CODE ref in your TYPE() attribute rather than modifying this hash.
=head1 DESCRIPTION
DO NOT USE THIS MODULE DIRECTLY!! Its used by Variable::Strongly::Typed to do its magic.
Download (0.010MB)
Added: 2007-01-18 License: Perl Artistic License Price:
1009 downloads
Libeval 1.0.7
Libeval provides simple means of evaluating simple arithmetic expressions. more>>
Libeval provides simple means of evaluating simple arithmetic expressions involving literal numeric values, variables and functions using the addition (+), subtraction (-), multiplication (*), division (/), modulo division (), exponentiation (^), sign (+-), percentag (%) and grouping (()) operators.
Libeval provides a means of setting and interrogating variables, defining functions and converting error codes into human readable strings. A number of predefined functions are included with libeval that wrap the existing standard C library math functions.
You can evaluate an expression by calling the eval() function. eval() takes two parameters, the expression to evaluate (as a simple C string) and a reference to a double precision float in which to put the result. If eval() encounters an error it returns a non-zero value, otherwise, if everything went well, it returns zero.
The error code returned by eval() can be converted into a human readable string by the eval_error() function. eval_error() takes one parameter, the error code returned by eval(),and returns a constant string describing the error.
Variables can be manipulated with the eval_set_var() and eval_get_var() functions.
eval_set_var() sets the named variable to the specified double precision value. eval_set_var() takes two parameters, the name of the variable to set as a simple C string, and the double precision float value to set the variable to. it returns 0 (zero) on success, non-zero on failure.
eval_get_var() gets the value of the named variable. eval_get_var() takes two parameters, the name of the variable as a simple C string and a reference to a double precision float in which to store the variables value. it returns 0 (zero) on success, non-zero on failure.
Functions can be defined with the eval_def_fn() function, which takes the name of the function as a simple C string, a pointer to a C function implementing the function, a pointer to a block of custom storage for use by the function and the number of arguments taken by the function. The prototype for the implementation function is:
int fn(int args, double *arg, double *rv, void *data);
The first two parameters (args and arg) are similar to the standard parameters to the main() function in C, the args parameter indicates how many elements are the argument list, and arg is the argument list itself. The third parameter (rv) is the return value from the function. The last parameter (data) is the custome storage block passed in when the function was defined.
If you specify a positive value (including zero) as the number of arguments for a function, libeval will only all the function to be called with exactly that number of parameters. If you specify a -1 (negative one) for the number of arguments, the function can be called with any number of parameters.
The following functions are predefined:
abs(x) absolute value of x
int(x) integer part of x
round(x) round x to nearest integer
trunc(x) truncate x (same as int(x))
floor(x) round x to nearest lesser integer
ceil(x) round x to nearest greater integer
sin(x) sine of x (radians)
cos(x) cosine of x (radians)
tan(x) tangent of x (radians)
asin(x) arc sine of x (radians)
acos(x) arc cosine of x (radians)
atan(x) arc tangent of x (radians)
sinh(x) hyperbolic sine of x (radians)
cosh(x) hyperbolic cosine of x (radians)
tanh(x) hyperbolic tangent of x (radians)
asinh(x) hyperbolic arc sine of x (radians)
acosh(x) hyperbolic arc cosine of x (radians)
atanh(x) hyperbolic arc tangent of x (radians)
deg(x) convert radians to degrees
rad(x) convert degrees to radians
ln(x) natural logarithm of x
log(x) base 10 logarithm of x
sqrt(x) square root of x
exp(x) e to x power
rand() random number between 0.0 and 1.0
fact(x) factorial of x (or gamma(x) if x is non-integer)
sum(...) sum of the arguments
min(...) minimum value in arguments
max(...) maximum value in arguments
avg(...) average of arguments
med(...) median of arguments
var(...) variance of arguments
std(...) standard deviation of arguments
Finally, you can get a set of bookkeepping information about the eval_expr libray with the eval_info() function. eval_info() takes nine parmaeters: three references to integer values for the version, revision and build numbers of the current eval_expr library, and three pairs of buffer address and buffer size limit for authors name, copyright info and license info.
You can use libeval by including the libeval header in your program source
#include
and then by linking your program against the libeval library
gcc -o myprog myprog.c -leval
Enhancements:
- A bug in the var() function and version string construction were fixed.
<<lessLibeval provides a means of setting and interrogating variables, defining functions and converting error codes into human readable strings. A number of predefined functions are included with libeval that wrap the existing standard C library math functions.
You can evaluate an expression by calling the eval() function. eval() takes two parameters, the expression to evaluate (as a simple C string) and a reference to a double precision float in which to put the result. If eval() encounters an error it returns a non-zero value, otherwise, if everything went well, it returns zero.
The error code returned by eval() can be converted into a human readable string by the eval_error() function. eval_error() takes one parameter, the error code returned by eval(),and returns a constant string describing the error.
Variables can be manipulated with the eval_set_var() and eval_get_var() functions.
eval_set_var() sets the named variable to the specified double precision value. eval_set_var() takes two parameters, the name of the variable to set as a simple C string, and the double precision float value to set the variable to. it returns 0 (zero) on success, non-zero on failure.
eval_get_var() gets the value of the named variable. eval_get_var() takes two parameters, the name of the variable as a simple C string and a reference to a double precision float in which to store the variables value. it returns 0 (zero) on success, non-zero on failure.
Functions can be defined with the eval_def_fn() function, which takes the name of the function as a simple C string, a pointer to a C function implementing the function, a pointer to a block of custom storage for use by the function and the number of arguments taken by the function. The prototype for the implementation function is:
int fn(int args, double *arg, double *rv, void *data);
The first two parameters (args and arg) are similar to the standard parameters to the main() function in C, the args parameter indicates how many elements are the argument list, and arg is the argument list itself. The third parameter (rv) is the return value from the function. The last parameter (data) is the custome storage block passed in when the function was defined.
If you specify a positive value (including zero) as the number of arguments for a function, libeval will only all the function to be called with exactly that number of parameters. If you specify a -1 (negative one) for the number of arguments, the function can be called with any number of parameters.
The following functions are predefined:
abs(x) absolute value of x
int(x) integer part of x
round(x) round x to nearest integer
trunc(x) truncate x (same as int(x))
floor(x) round x to nearest lesser integer
ceil(x) round x to nearest greater integer
sin(x) sine of x (radians)
cos(x) cosine of x (radians)
tan(x) tangent of x (radians)
asin(x) arc sine of x (radians)
acos(x) arc cosine of x (radians)
atan(x) arc tangent of x (radians)
sinh(x) hyperbolic sine of x (radians)
cosh(x) hyperbolic cosine of x (radians)
tanh(x) hyperbolic tangent of x (radians)
asinh(x) hyperbolic arc sine of x (radians)
acosh(x) hyperbolic arc cosine of x (radians)
atanh(x) hyperbolic arc tangent of x (radians)
deg(x) convert radians to degrees
rad(x) convert degrees to radians
ln(x) natural logarithm of x
log(x) base 10 logarithm of x
sqrt(x) square root of x
exp(x) e to x power
rand() random number between 0.0 and 1.0
fact(x) factorial of x (or gamma(x) if x is non-integer)
sum(...) sum of the arguments
min(...) minimum value in arguments
max(...) maximum value in arguments
avg(...) average of arguments
med(...) median of arguments
var(...) variance of arguments
std(...) standard deviation of arguments
Finally, you can get a set of bookkeepping information about the eval_expr libray with the eval_info() function. eval_info() takes nine parmaeters: three references to integer values for the version, revision and build numbers of the current eval_expr library, and three pairs of buffer address and buffer size limit for authors name, copyright info and license info.
You can use libeval by including the libeval header in your program source
#include
and then by linking your program against the libeval library
gcc -o myprog myprog.c -leval
Enhancements:
- A bug in the var() function and version string construction were fixed.
Download (0.027MB)
Added: 2007-01-17 License: LGPL (GNU Lesser General Public License) Price:
1011 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 variable names 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