data
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 4871
Data::ICal 0.11
Data::ICal is a Perl module that generates iCalendar (RFC 2445) calendar files. more>>
Data::ICal is a Perl module that generates iCalendar (RFC 2445) calendar files.
SYNOPSIS
use Data::ICal;
my $calendar = Data::ICal->new();
my $vtodo = Data::ICal::Entry::Todo->new();
$vtodo->add_properties(
# ... see Data::ICal::Entry::Todo documentation
);
# ... or
$calendar = Data::ICal->new(filename => foo.ics); # parse existing file
$calendar = Data::ICal->new(data => BEGIN:VCALENDAR...); # parse existing file
$calendar->add_entry($vtodo);
print $calendar->as_string;
# Or, if youre printing to something you want google to read:
print $calendar->as_string(fold => 0);
A Data::ICal object represents a VCALENDAR object as defined in the iCalendar protocol (RFC 2445, MIME type "text/calendar"), as implemented in many popular calendaring programs such as Apples iCal.
Each Data::ICal object is a collection of "entries", which are objects of a subclass of Data::ICal::Entry. The types of entries defined by iCalendar (which refers to them as "components") include events, to-do items, journal entries, free/busy time indicators, and time zone descriptors; in addition, events and to-do items can contain alarm entries. (Currently, Data::ICal only implements to-do items and events.)
Data::ICal is a subclass of Data::ICal::Entry; see its manpage for more methods applicable to Data::ICal.
<<lessSYNOPSIS
use Data::ICal;
my $calendar = Data::ICal->new();
my $vtodo = Data::ICal::Entry::Todo->new();
$vtodo->add_properties(
# ... see Data::ICal::Entry::Todo documentation
);
# ... or
$calendar = Data::ICal->new(filename => foo.ics); # parse existing file
$calendar = Data::ICal->new(data => BEGIN:VCALENDAR...); # parse existing file
$calendar->add_entry($vtodo);
print $calendar->as_string;
# Or, if youre printing to something you want google to read:
print $calendar->as_string(fold => 0);
A Data::ICal object represents a VCALENDAR object as defined in the iCalendar protocol (RFC 2445, MIME type "text/calendar"), as implemented in many popular calendaring programs such as Apples iCal.
Each Data::ICal object is a collection of "entries", which are objects of a subclass of Data::ICal::Entry. The types of entries defined by iCalendar (which refers to them as "components") include events, to-do items, journal entries, free/busy time indicators, and time zone descriptors; in addition, events and to-do items can contain alarm entries. (Currently, Data::ICal only implements to-do items and events.)
Data::ICal is a subclass of Data::ICal::Entry; see its manpage for more methods applicable to Data::ICal.
Download (0.10MB)
Added: 2006-12-01 License: Perl Artistic License Price:
1059 downloads
Test::Data 1.20
Test::Data is a Perl module to test functions for particular variable types. more>>
Test::Data is a Perl module to test functions for particular variable types.
SYNOPSIS
use Test::Data qw(Scalar Array Hash Function);
Test::Data provides utility functions to check properties and values of data and variables.
Functions
Plug-in modules define functions for each data type. See the appropriate module.
How it works
The Test::Data module simply emports functions from Test::Data::* modules. Each module defines a self-contained function, and puts that function name into @EXPORT. Test::Data defines its own import function, but that does not matter to the plug-in modules.
If you want to write a plug-in module, follow the example of one that already exists. Name the module Test::Data::Foo, where you replace Foo with the right name. Test::Data should automatically find it.
<<lessSYNOPSIS
use Test::Data qw(Scalar Array Hash Function);
Test::Data provides utility functions to check properties and values of data and variables.
Functions
Plug-in modules define functions for each data type. See the appropriate module.
How it works
The Test::Data module simply emports functions from Test::Data::* modules. Each module defines a self-contained function, and puts that function name into @EXPORT. Test::Data defines its own import function, but that does not matter to the plug-in modules.
If you want to write a plug-in module, follow the example of one that already exists. Name the module Test::Data::Foo, where you replace Foo with the right name. Test::Data should automatically find it.
Download (0.008MB)
Added: 2007-05-03 License: Perl Artistic License Price:
904 downloads
Data::Stag 0.10
Data::Stag is a Perl module with structured tags datastructures. more>>
Data::Stag is a Perl module with structured tags datastructures.
SYNOPSIS
# PROCEDURAL USAGE
use Data::Stag qw(:all);
$doc = stag_parse($file);
@persons = stag_find($doc, "person");
foreach $p (@persons) {
printf "%s, %s phone: %sn",
stag_sget($p, "family_name"),
stag_sget($p, "given_name"),
stag_sget($p, "phone_no"),
;
}
# OBJECT-ORIENTED USAGE
use Data::Stag;
$doc = Data::Stag->parse($file);
@persons = $doc->find("person");
foreach $p (@person) {
printf "%s, %s phone:%sn",
$p->sget("family_name"),
$p->sget("given_name"),
$p->sget("phone_no"),
;
}
This module is for manipulating data as hierarchical tag/value pairs (Structured TAGs or Simple Tree AGgreggates).
<<lessSYNOPSIS
# PROCEDURAL USAGE
use Data::Stag qw(:all);
$doc = stag_parse($file);
@persons = stag_find($doc, "person");
foreach $p (@persons) {
printf "%s, %s phone: %sn",
stag_sget($p, "family_name"),
stag_sget($p, "given_name"),
stag_sget($p, "phone_no"),
;
}
# OBJECT-ORIENTED USAGE
use Data::Stag;
$doc = Data::Stag->parse($file);
@persons = $doc->find("person");
foreach $p (@person) {
printf "%s, %s phone:%sn",
$p->sget("family_name"),
$p->sget("given_name"),
$p->sget("phone_no"),
;
}
This module is for manipulating data as hierarchical tag/value pairs (Structured TAGs or Simple Tree AGgreggates).
Download (0.43MB)
Added: 2006-10-03 License: Perl Artistic License Price:
1117 downloads
Data::Diff 0.01
Data::Diff is a data structure comparison module. more>>
Data::Diff is a data structure comparison module.
SYNOPSIS
use Data::Diff qw(diff);
# simple procedural interface to raw difference output
$out = diff( $a, $b );
# OO usage
$diff = Data::Diff->new( $a, $b );
$new = $diff->apply();
$changes = $diff->diff_a();
Data::Diff computes the differences between two abirtray complex data structures.
METHODS
Creation
new Data::Diff( $a, $b, $options )
Creates and retruns a new Data::Diff object with the differences between $a and $b.
Access
apply( $options )
Returns the result of applying one side over the other.
raw()
Returns the internal data structure that describes the differences at all levels within.
Functions
Diff( $a, $b, $options )
Compares the two arguments $a and $b and returns the raw comparison between the two.
EXPORT
Nothing by default but you can choose to export the non-OO function Diff().
<<lessSYNOPSIS
use Data::Diff qw(diff);
# simple procedural interface to raw difference output
$out = diff( $a, $b );
# OO usage
$diff = Data::Diff->new( $a, $b );
$new = $diff->apply();
$changes = $diff->diff_a();
Data::Diff computes the differences between two abirtray complex data structures.
METHODS
Creation
new Data::Diff( $a, $b, $options )
Creates and retruns a new Data::Diff object with the differences between $a and $b.
Access
apply( $options )
Returns the result of applying one side over the other.
raw()
Returns the internal data structure that describes the differences at all levels within.
Functions
Diff( $a, $b, $options )
Compares the two arguments $a and $b and returns the raw comparison between the two.
EXPORT
Nothing by default but you can choose to export the non-OO function Diff().
Download (0.006MB)
Added: 2007-07-13 License: Perl Artistic License Price:
833 downloads
File::Data 1.12
File::Data is a Perl module as a interface to file data. more>>
File::Data is a Perl module as a interface to file data.
Wraps all the accessing of a file into a convenient set of calls for reading and writing data, including a simple regex interface.
Note that the file needs to exist prior to using this module!
See new()
SYNOPSIS
use strict;
use File::Data;
my $o_dat = File::Data->new(./t/example);
$o_dat->write("complete file contentsn");
$o_dat->prepend("first linen"); # line 0
$o_dat->append("original second (last) linen");
$o_dat->insert(2, "new second linen"); # inc. zero!
$o_dat->replace(line, LINE);
print $o_dat->READ;
Or, perhaps more seriously :-}
my $o_sgm = File::Data->new(./sgmlfile);
print "new SGML data: ".$o_sgm->REPLACE(
s*((?s).*)s* ,
qq| key="val" |,
) if $o_sgm;
See METHODS and EXAMPLES.
IMPORTANT
lowercase method calls return the object itself, so you can chain calls.
my $o_obj = $o_dat->read; # ! READ; # !<<less
Wraps all the accessing of a file into a convenient set of calls for reading and writing data, including a simple regex interface.
Note that the file needs to exist prior to using this module!
See new()
SYNOPSIS
use strict;
use File::Data;
my $o_dat = File::Data->new(./t/example);
$o_dat->write("complete file contentsn");
$o_dat->prepend("first linen"); # line 0
$o_dat->append("original second (last) linen");
$o_dat->insert(2, "new second linen"); # inc. zero!
$o_dat->replace(line, LINE);
print $o_dat->READ;
Or, perhaps more seriously :-}
my $o_sgm = File::Data->new(./sgmlfile);
print "new SGML data: ".$o_sgm->REPLACE(
s*((?s).*)s* ,
qq| key="val" |,
) if $o_sgm;
See METHODS and EXAMPLES.
IMPORTANT
lowercase method calls return the object itself, so you can chain calls.
my $o_obj = $o_dat->read; # ! READ; # !<<less
Download (0.013MB)
Added: 2007-04-26 License: Perl Artistic License Price:
914 downloads
Data::Page 2.00
Data::Page is a Perl module that helps when paging through sets of results. more>>
Data::Page is a Perl module that helps when paging through sets of results.
SYNOPSIS
use Data::Page;
my $page = Data::Page->new();
$page->total_entries($total_entries);
$page->entries_per_page($entries_per_page);
$page->current_page($current_page);
print " First page: ", $page->first_page, "n";
print " Last page: ", $page->last_page, "n";
print "First entry on page: ", $page->first, "n";
print " Last entry on page: ", $page->last, "n";
When searching through large amounts of data, it is often the case that a result set is returned that is larger than we want to display on one page. This results in wanting to page through various pages of data. The maths behind this is unfortunately fiddly, hence this module.
The main concept is that you pass in the number of total entries, the number of entries per page, and the current page number. You can then call methods to find out how many pages of information there are, and what number the first and last entries on the current page really are.
For example, say we wished to page through the integers from 1 to 100 with 20 entries per page. The first page would consist of 1-20, the second page from 21-40, the third page from 41-60, the fourth page from 61-80 and the fifth page from 81-100. This module would help you work this out.
<<lessSYNOPSIS
use Data::Page;
my $page = Data::Page->new();
$page->total_entries($total_entries);
$page->entries_per_page($entries_per_page);
$page->current_page($current_page);
print " First page: ", $page->first_page, "n";
print " Last page: ", $page->last_page, "n";
print "First entry on page: ", $page->first, "n";
print " Last entry on page: ", $page->last, "n";
When searching through large amounts of data, it is often the case that a result set is returned that is larger than we want to display on one page. This results in wanting to page through various pages of data. The maths behind this is unfortunately fiddly, hence this module.
The main concept is that you pass in the number of total entries, the number of entries per page, and the current page number. You can then call methods to find out how many pages of information there are, and what number the first and last entries on the current page really are.
For example, say we wished to page through the integers from 1 to 100 with 20 entries per page. The first page would consist of 1-20, the second page from 21-40, the third page from 41-60, the fourth page from 61-80 and the fifth page from 81-100. This module would help you work this out.
Download (0.006MB)
Added: 2006-10-31 License: Perl Artistic License Price:
1088 downloads
SOAP::Data 0.69
SOAP::Data is a Perl class that provides the means by which to explicitly manipulate and control all aspects of the way. more>>
SOAP::Data is a Perl class that provides the means by which to explicitly manipulate and control all aspects of the way in which Perl data gets expressed as SOAP data entities.
The SOAP::Data class provides the means by which to explicitly manipulate and control all aspects of the way in which Perl data gets expressed as SOAP data entities. Most of the methods are accessors, which like those in SOAP::Lite are designed to return the current value if no new one is passed, while returning the object reference otherwise (allowing for chained method calls). Note that most accessors (except value) accept a new value for the data object as a second argument.
METHODS
new(optional key/value pairs)
$obj = SOAP::Data->new(name => idx, value => 5);
This is the class constructor. Almost all of the attributes related to the class may be passed to the constructor as key/value pairs. This method isnt often used directly because SOAP::Data objects are generally created for temporary use. It is available for those situations that require it.
name(new name, optional value)
$obj->name(index);
Gets or sets the current value of the name, as the object regards it. The name is what the serializer will use for the tag when generating the XML for this object. It is what will become the accessor for the data element. Optionally, the objects value may be updated if passed as a second argument.
type(new type, optional value)
$obj->type(int);
Gets or sets the type associated with the current value in the object. This is useful for those cases where the SOAP::Data object is used to explicitly specify the type of data that would otherwise be interpreted as a different type completely (such as perceiving the string 123 as an integer, instead). Allows the setting of the objects value, if passed as a second argument to the method.
uri(new uri, optional value)
$obj->uri(http://www.perl.com/SOAP);
Gets or sets the URI that will be used as the namespace for the resulting XML entity, if one is desired. This doesnt set the label for the namespace. If one isnt provided by means of the prefix method, one is generated automatically when needed. Also allows the setting of the objects value, if passed as a second argument to the method.
prefix(new prefix, optional value)
$obj->prefix(perl);
Provides the prefix, or label, for use when associating the data object with a specific namespace. Also allows the setting of the objects value, if passed as a second argument to the method.
attr(hash reference of attributes, optional value)
$obj->attr({ attr1 => value });
Allows for the setting of arbitrary attributes on the data object. Keep in mind the requirement that any attributes not natively known to SOAP must be namespace-qualified. Also allows the setting of the objects value, if passed as a second argument to the method.
value(new value)
$obj->value(10);
Fetches the current value encapsulated by the object, or explicitly sets it.
The last four methods are convenience shortcuts for the attributes that SOAP itself supports. Each also permits inclusion of a new value, as an optional second argument.
actor(new actor, optional value)
$obj->actor($new_actor_name);
Gets or sets the value of the actor attribute; useful only when the object generates an entity for the message header.
mustUnderstand(boolean, optional value)
$obj->mustUnderstand(0);
Manipulates the mustUnderstand attribute, which tells the SOAP processor whether it is required to understand the entity in question.
encodingStyle(new encoding URN, optional value)
$obj->encodingStyle($soap_11_encoding);
This method is most likely to be used in places outside the header creation. Sets encodingStyle, which specifies an encoding that differs from the one that would otherwise be defaulted to.
root(boolean, optional value)
$obj->root(1);
When the application must explicitly specify which data element is to be regarded as the root element for the sake of generating the object model, this method provides the access to the root attribute.
<<lessThe SOAP::Data class provides the means by which to explicitly manipulate and control all aspects of the way in which Perl data gets expressed as SOAP data entities. Most of the methods are accessors, which like those in SOAP::Lite are designed to return the current value if no new one is passed, while returning the object reference otherwise (allowing for chained method calls). Note that most accessors (except value) accept a new value for the data object as a second argument.
METHODS
new(optional key/value pairs)
$obj = SOAP::Data->new(name => idx, value => 5);
This is the class constructor. Almost all of the attributes related to the class may be passed to the constructor as key/value pairs. This method isnt often used directly because SOAP::Data objects are generally created for temporary use. It is available for those situations that require it.
name(new name, optional value)
$obj->name(index);
Gets or sets the current value of the name, as the object regards it. The name is what the serializer will use for the tag when generating the XML for this object. It is what will become the accessor for the data element. Optionally, the objects value may be updated if passed as a second argument.
type(new type, optional value)
$obj->type(int);
Gets or sets the type associated with the current value in the object. This is useful for those cases where the SOAP::Data object is used to explicitly specify the type of data that would otherwise be interpreted as a different type completely (such as perceiving the string 123 as an integer, instead). Allows the setting of the objects value, if passed as a second argument to the method.
uri(new uri, optional value)
$obj->uri(http://www.perl.com/SOAP);
Gets or sets the URI that will be used as the namespace for the resulting XML entity, if one is desired. This doesnt set the label for the namespace. If one isnt provided by means of the prefix method, one is generated automatically when needed. Also allows the setting of the objects value, if passed as a second argument to the method.
prefix(new prefix, optional value)
$obj->prefix(perl);
Provides the prefix, or label, for use when associating the data object with a specific namespace. Also allows the setting of the objects value, if passed as a second argument to the method.
attr(hash reference of attributes, optional value)
$obj->attr({ attr1 => value });
Allows for the setting of arbitrary attributes on the data object. Keep in mind the requirement that any attributes not natively known to SOAP must be namespace-qualified. Also allows the setting of the objects value, if passed as a second argument to the method.
value(new value)
$obj->value(10);
Fetches the current value encapsulated by the object, or explicitly sets it.
The last four methods are convenience shortcuts for the attributes that SOAP itself supports. Each also permits inclusion of a new value, as an optional second argument.
actor(new actor, optional value)
$obj->actor($new_actor_name);
Gets or sets the value of the actor attribute; useful only when the object generates an entity for the message header.
mustUnderstand(boolean, optional value)
$obj->mustUnderstand(0);
Manipulates the mustUnderstand attribute, which tells the SOAP processor whether it is required to understand the entity in question.
encodingStyle(new encoding URN, optional value)
$obj->encodingStyle($soap_11_encoding);
This method is most likely to be used in places outside the header creation. Sets encodingStyle, which specifies an encoding that differs from the one that would otherwise be defaulted to.
root(boolean, optional value)
$obj->root(1);
When the application must explicitly specify which data element is to be regarded as the root element for the sake of generating the object model, this method provides the access to the root attribute.
Download (0.23MB)
Added: 2006-09-16 License: Perl Artistic License Price:
1133 downloads
Data::ENAML 0.03
Data::ENAML is a Perl extension for ENAML data representation. more>>
Data::ENAML is a Perl extension for ENAML data representation.
SYNOPSIS
use Data::ENAML qw (serialize deserialize);
print serialize(login => {nick => Schop,
email => ariel@atheist.org.il,
tagline => If I had no modem I would not lose Regina});
$struct = deserialize(bad-nick: {nick: "c00l dewd" text: "spaces not allowed"});
ENAML stands for ENAML is Not A Markup Language. (And as we all know, Gnu is Not UNIX, Pine Is Not Email, Wine Is Not Emulator, Lame Aint Mp3 Encoder and so on).
ENAML was defined by Robey Pointer for use in Say2, check http://www.lag.net/say2.
<<lessSYNOPSIS
use Data::ENAML qw (serialize deserialize);
print serialize(login => {nick => Schop,
email => ariel@atheist.org.il,
tagline => If I had no modem I would not lose Regina});
$struct = deserialize(bad-nick: {nick: "c00l dewd" text: "spaces not allowed"});
ENAML stands for ENAML is Not A Markup Language. (And as we all know, Gnu is Not UNIX, Pine Is Not Email, Wine Is Not Emulator, Lame Aint Mp3 Encoder and so on).
ENAML was defined by Robey Pointer for use in Say2, check http://www.lag.net/say2.
Download (0.004MB)
Added: 2006-11-15 License: Perl Artistic License Price:
1073 downloads
Data::Secs2 0.09
Data::Secs2 is a Perl module to pack, unpack, format, transform from Perl data SEMI E5-94 nested data. more>>
Data::Secs2 is a Perl module to pack, unpack, format, transform from Perl data SEMI E5-94 nested data.
SYNOPSIS
#####
# Subroutine interface
#
use Data::Secs2 qw(arrayify config listify neuterify numberify perlify
perl_typify secsify secs_elementify stringify textify transify);
@array = arrayify($ref, @options);
$old_value = config( $option );
$old_value = config( $option => $new_value);
$body = secs_elementify($format, $cells, @options);
@secs_obj = listify(@vars);
@secs_obj = neuterify($binary_secs, @options);
@vars = perlify(@secs_obj, @options);
$ref = perl_typify(@array, @options);
$ascii_secs = secsify( @secs_obj, @options);
$binary_secs = secsify( @secs_obj, type => binary);
$string = stringify(@arg, [@options]);
@secs_obj = transify($acsii_secs, @options);
#####
# Class, Object interface
#
# For class interface, use Data::Secs2 instead of $self
# use Data::Secs2;
#
$secs2 = Data::Secs2 # uses built-in config object
$secs2 = new Data::Secs2( @options );
@array = secs2->arrayify( $ref, @options );
$old_value = secs2->secs_config( $option);
$old_value = secs2->secs_config( $option => $new_value);
$body = secs2->secs_elementify($format, $cells, @options);
@secs_obj = secs2->listify(@vars, @options);
@secs_obj = secs2->neuterify($binary_secs, @options);
@vars = secs2->perlify(@secs_obj, @options);
$ref = secs2->perl_typify(@array, @options);
$ascii_secs = secs2->secsify( @secs_obj, @options);
$binary_secs = secs2->secsify( @secs_obj, type => binary);
$body = secs2->stringify( @arg );
@secs_obj = secs2->transify($acsii_secs, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
<<lessSYNOPSIS
#####
# Subroutine interface
#
use Data::Secs2 qw(arrayify config listify neuterify numberify perlify
perl_typify secsify secs_elementify stringify textify transify);
@array = arrayify($ref, @options);
$old_value = config( $option );
$old_value = config( $option => $new_value);
$body = secs_elementify($format, $cells, @options);
@secs_obj = listify(@vars);
@secs_obj = neuterify($binary_secs, @options);
@vars = perlify(@secs_obj, @options);
$ref = perl_typify(@array, @options);
$ascii_secs = secsify( @secs_obj, @options);
$binary_secs = secsify( @secs_obj, type => binary);
$string = stringify(@arg, [@options]);
@secs_obj = transify($acsii_secs, @options);
#####
# Class, Object interface
#
# For class interface, use Data::Secs2 instead of $self
# use Data::Secs2;
#
$secs2 = Data::Secs2 # uses built-in config object
$secs2 = new Data::Secs2( @options );
@array = secs2->arrayify( $ref, @options );
$old_value = secs2->secs_config( $option);
$old_value = secs2->secs_config( $option => $new_value);
$body = secs2->secs_elementify($format, $cells, @options);
@secs_obj = secs2->listify(@vars, @options);
@secs_obj = secs2->neuterify($binary_secs, @options);
@vars = secs2->perlify(@secs_obj, @options);
$ref = secs2->perl_typify(@array, @options);
$ascii_secs = secs2->secsify( @secs_obj, @options);
$binary_secs = secs2->secsify( @secs_obj, type => binary);
$body = secs2->stringify( @arg );
@secs_obj = secs2->transify($acsii_secs, @options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
Download (0.096MB)
Added: 2007-02-15 License: Perl Artistic License Price:
981 downloads
Gimp::Data 1.211
Gimp::Data is a Perl module to set and get state data. more>>
Gimp::Data is a Perl module to set and get state data.
SYNOPSIS
use Gimp::Data;
$Gimp::Data{value1} = "Hello";
print $Gimp::Data{value1},", World!!n";
With this module, you can access plugin-specific (or global) data in Gimp, i.e. you can store and retrieve values that are stored in the main Gimp application.
An example would be to save parameter values in Gimp, so that on subsequent invocations of your plug-in, the user does not have to set all parameter values again (Gimp::Fu does this already).
<<lessSYNOPSIS
use Gimp::Data;
$Gimp::Data{value1} = "Hello";
print $Gimp::Data{value1},", World!!n";
With this module, you can access plugin-specific (or global) data in Gimp, i.e. you can store and retrieve values that are stored in the main Gimp application.
An example would be to save parameter values in Gimp, so that on subsequent invocations of your plug-in, the user does not have to set all parameter values again (Gimp::Fu does this already).
Download (0.26MB)
Added: 2006-10-26 License: Perl Artistic License Price:
1093 downloads
Data::Region 1.0
Data::Region Perl module can define hierarchical areas with behaviors. more>>
Data::Region Perl module can define hierarchical areas with behaviors.
SYNOPSIS
use Data::Region;
$r = Data::Region->new( 8.5, 11, { data => PageObj->new() } );
$r->data( PageObj->new() );
foreach my $c ( $r->subdivide(2.5,3) ) {
$a = $c->area(0.25,0.25, 2.25,2.75);
$a2 = $c->area(0.25,0.25, -0.25,-0.25); # as offset from lower right
($t,$m,$b) = $a->split_vertical(2,5,1); # sequential heights
($t,$m,$b) = $a->split_vertical_abs(0,2,7); # absolute offsets
($l,$r) = $a->split_horizontal(2); # $l gets width of 2, $r gets the rest
my($x1,$y1,$x2,$y2) = $a->coords();
my $data = $a->data(); # data inherits from parent, if not set
$a->action( sub { $data->setfont("Times-Bold", 10);
$data->text($x1,$y1, "Some Text");
$data->line( $_[0]->coords() ); # the non-closure way
} );
}
$r->render(); # heirarchically perform all the actions
# Get some info about a region:
($w,$h) = ( $a->width(), $a->height() );
($x1,$y1, $x2,$y2) = $a->coords();
($x1,$y1) = $a->top_left();
($x2,$y1) = $a->top_right();
($x1,$y2) = $a->bottom_left();
($x2,$y2) = $a->bottom_right();
Data::Region allows you to easily define a set of nested (2-dimensional) areas, defined by related coordinates, and to associate actions with them. The actions can then be performed hierarchically from any root of the tree.
Data::Region was written to provide an easy way to do simple page layout, but has, perhaps, more general uses.
<<lessSYNOPSIS
use Data::Region;
$r = Data::Region->new( 8.5, 11, { data => PageObj->new() } );
$r->data( PageObj->new() );
foreach my $c ( $r->subdivide(2.5,3) ) {
$a = $c->area(0.25,0.25, 2.25,2.75);
$a2 = $c->area(0.25,0.25, -0.25,-0.25); # as offset from lower right
($t,$m,$b) = $a->split_vertical(2,5,1); # sequential heights
($t,$m,$b) = $a->split_vertical_abs(0,2,7); # absolute offsets
($l,$r) = $a->split_horizontal(2); # $l gets width of 2, $r gets the rest
my($x1,$y1,$x2,$y2) = $a->coords();
my $data = $a->data(); # data inherits from parent, if not set
$a->action( sub { $data->setfont("Times-Bold", 10);
$data->text($x1,$y1, "Some Text");
$data->line( $_[0]->coords() ); # the non-closure way
} );
}
$r->render(); # heirarchically perform all the actions
# Get some info about a region:
($w,$h) = ( $a->width(), $a->height() );
($x1,$y1, $x2,$y2) = $a->coords();
($x1,$y1) = $a->top_left();
($x2,$y1) = $a->top_right();
($x1,$y2) = $a->bottom_left();
($x2,$y2) = $a->bottom_right();
Data::Region allows you to easily define a set of nested (2-dimensional) areas, defined by related coordinates, and to associate actions with them. The actions can then be performed hierarchically from any root of the tree.
Data::Region was written to provide an easy way to do simple page layout, but has, perhaps, more general uses.
Download (0.008MB)
Added: 2007-08-03 License: Perl Artistic License Price:
812 downloads

Data Crow 3.4.13
Data Crow is an excellent and must-have product which offers you the ultimate media cataloger and media organizer. more>> <<less
Added: 2009-07-26 License: GPL Price: FREE
79 downloads
Data::CGIForm 0.4
Data::CGIForm is a Perl module with form data interface. more>>
Data::CGIForm is a Perl module with form data interface.
Data::CGIForm is yet another way to parse and handle CGI form data. The main motivation behind this module was a simple specification based validator that could handle multiple values.
You probably dont want to use this module. CGI::Validate is a much more feature complete take on getting this sort of work done. You may then ask why this is on the CPAN, I ask that of myself from time to time....
SYNOPSIS
my %spec = (
username => qr/^([a-z0-9]+)$/,
password => {
regexp => qr/^([a-z0-9+])$/,
filter => [qw(strip_leading_ws, strip_trailing_ws)],
},
email => {
regexp => qr/^([a-z0-9@.]+)$/,
filter => &qualify_domain,
optional => 1,
errors => {
empty => You didnt enter an email address.,
invalid => Bad [% key %]: "[% value %]",
},
extra_test => &check_email_addr,
},
email2 => {
equal_to => email,
errors => {
unequal => Both email addresses must be the same.,
},
},
);
my $r = $ENV{MOD_PERL} ? Apache::Request->instance : CGI->new;
my $form = Data::CGIForm->new(datasource => $r, spec => %spec);
my @params = $form->params;
foreach $param (@params) {
next unless my $error_string = $form->error($param);
print STDERR $error_string;
}
if ($form->error(username)) {
handle_error($form->username, $form->error(username));
}
my $email = $form->param(email);
my $password = $form->password;
<<lessData::CGIForm is yet another way to parse and handle CGI form data. The main motivation behind this module was a simple specification based validator that could handle multiple values.
You probably dont want to use this module. CGI::Validate is a much more feature complete take on getting this sort of work done. You may then ask why this is on the CPAN, I ask that of myself from time to time....
SYNOPSIS
my %spec = (
username => qr/^([a-z0-9]+)$/,
password => {
regexp => qr/^([a-z0-9+])$/,
filter => [qw(strip_leading_ws, strip_trailing_ws)],
},
email => {
regexp => qr/^([a-z0-9@.]+)$/,
filter => &qualify_domain,
optional => 1,
errors => {
empty => You didnt enter an email address.,
invalid => Bad [% key %]: "[% value %]",
},
extra_test => &check_email_addr,
},
email2 => {
equal_to => email,
errors => {
unequal => Both email addresses must be the same.,
},
},
);
my $r = $ENV{MOD_PERL} ? Apache::Request->instance : CGI->new;
my $form = Data::CGIForm->new(datasource => $r, spec => %spec);
my @params = $form->params;
foreach $param (@params) {
next unless my $error_string = $form->error($param);
print STDERR $error_string;
}
if ($form->error(username)) {
handle_error($form->username, $form->error(username));
}
my $email = $form->param(email);
my $password = $form->password;
Download (0.012MB)
Added: 2006-10-04 License: Perl Artistic License Price:
1115 downloads
Data::CTable 1.03
Data::CTable is a Perl module that helps you read, write, manipulate tabular data. more>>
Data::CTable is a Perl module that helps you read, write, manipulate tabular data.
SYNOPSIS
## Read some data files in various tabular formats
use Data::CTable;
my $People = Data::CTable->new("people.merge.mac.txt");
my $Stats = Data::CTable->new("stats.tabs.unix.txt");
## Clean stray whitespace in fields
$People->clean_ws();
$Stats ->clean_ws();
## Retrieve columns
my $First = $People->col(FirstName);
my $Last = $People->col(LastName );
## Calculate a new column based on two others
my $Full = [map {"$First->[$_] $Last->[$_]"} @{$People->all()}];
## Add new column to the table
$People->col(FullName => $Full);
## Another way to calculate a new column
$People->col(Key);
$People->calc(sub {no strict vars; $Key = "$Last,$First";});
## "Left join" records matching Stats:PersonID to People:Key
$Stats->join($People, PersonID => Key);
## Find certain records
$Stats->select_all();
$Stats->select(Department => sub {/Sale/i }); ## Sales depts
$Stats->omit (Department => sub {/Resale/i}); ## not Resales
$Stats->select(UsageIndex => sub {$_ > 20.0}); ## high usage
## Sort the found records
$Stats->sortspec(DeptNum , {SortType => Integer});
$Stats->sortspec(UsageIndex, {SortType => Number });
$Stats->sort([qw(DeptNum UsageIndex Last First)]);
## Make copy of table with only found/sorted data, in order
my $Report = $Stats->snapshot();
## Write an output file
$Report->write(_FileName => "Rept.txt", _LineEnding => "mac");
## Print a final progress message.
$Stats->progress("Done!");
## Dozens more methods and parameters available...
OVERVIEW
Data::CTable is a comprehensive utility for reading, writing, manipulating, cleaning and otherwise transforming tabular data. The distribution includes several illustrative subclasses and utility scripts.
A Columnar Table represents a table as a hash of data columns, making it easy to do data cleanup, formatting, searching, calculations, joins, or other complex operations.
The objects hash keys are the field names and the hash values hold the data columns (as array references).
Tables also store a "selection" -- a list of selected / sorted record numbers, and a "field list" -- an ordered list of all or some fields to be operated on. Select() and sort() methods manipulate the selection list. Later, you can optionally rewrite the table in memory or on disk to reflect changes in the selection list or field list.
Data::CTable reads and writes any tabular text file format including Merge, CSV, Tab-delimited, and variants. It transparently detects, reads, and preserves Unix, Mac, and/or DOS line endings and tab or comma field delimiters -- regardless of the runtime platform.
In addition to reading data files, CTable is a good way to gather, store, and operate on tabular data in memory, and to export data to delimited text files to be read by other programs or interactive productivity applications.
To achieve extremely fast data loading, CTable caches data file contents using the Storable module. This can be helpful in CGI environments or when operating on very large data files. CTable can read an entire cached table of about 120 megabytes into memory in about 10 seconds on an average mid-range computer.
For simple data-driven applications needing to store and quickly retrieve simple tabular data sets, CTable provides a credible alternative to DBM files or SQL.
For data hygiene applications, CTable forms the foundation for writing utility scripts or compilers to transfer data from external sources, such as FileMaker, Excel, Access, personal organizers, etc. into compiled or validated formats -- or even as a gateway to loading data into SQL databases or other destinations. You can easily write short, repeatable scripts in Perl to do reporting, error checking, analysis, or validation that would be hard to duplicate in less-flexible application environments.
The data representation is simple and open so you can directly access the data in the object if you feel like it -- or you can use accessors to request "clean" structures containing only the data or copies of it. Or you can build your own columns in memory and then when youre ready, turn them into a table object using the very flexible new() method.
The highly factored interface and implementation allow fine-grained subclassing so you can easily create useful lightweight subclasses. Several subclasses are included with the distribution.
Most defaults and parameters can be customized by subclassing, overridden at the instance level (avoiding the need to subclass too often), and further overridden via optional named-parameter arguments to most major method calls.
<<lessSYNOPSIS
## Read some data files in various tabular formats
use Data::CTable;
my $People = Data::CTable->new("people.merge.mac.txt");
my $Stats = Data::CTable->new("stats.tabs.unix.txt");
## Clean stray whitespace in fields
$People->clean_ws();
$Stats ->clean_ws();
## Retrieve columns
my $First = $People->col(FirstName);
my $Last = $People->col(LastName );
## Calculate a new column based on two others
my $Full = [map {"$First->[$_] $Last->[$_]"} @{$People->all()}];
## Add new column to the table
$People->col(FullName => $Full);
## Another way to calculate a new column
$People->col(Key);
$People->calc(sub {no strict vars; $Key = "$Last,$First";});
## "Left join" records matching Stats:PersonID to People:Key
$Stats->join($People, PersonID => Key);
## Find certain records
$Stats->select_all();
$Stats->select(Department => sub {/Sale/i }); ## Sales depts
$Stats->omit (Department => sub {/Resale/i}); ## not Resales
$Stats->select(UsageIndex => sub {$_ > 20.0}); ## high usage
## Sort the found records
$Stats->sortspec(DeptNum , {SortType => Integer});
$Stats->sortspec(UsageIndex, {SortType => Number });
$Stats->sort([qw(DeptNum UsageIndex Last First)]);
## Make copy of table with only found/sorted data, in order
my $Report = $Stats->snapshot();
## Write an output file
$Report->write(_FileName => "Rept.txt", _LineEnding => "mac");
## Print a final progress message.
$Stats->progress("Done!");
## Dozens more methods and parameters available...
OVERVIEW
Data::CTable is a comprehensive utility for reading, writing, manipulating, cleaning and otherwise transforming tabular data. The distribution includes several illustrative subclasses and utility scripts.
A Columnar Table represents a table as a hash of data columns, making it easy to do data cleanup, formatting, searching, calculations, joins, or other complex operations.
The objects hash keys are the field names and the hash values hold the data columns (as array references).
Tables also store a "selection" -- a list of selected / sorted record numbers, and a "field list" -- an ordered list of all or some fields to be operated on. Select() and sort() methods manipulate the selection list. Later, you can optionally rewrite the table in memory or on disk to reflect changes in the selection list or field list.
Data::CTable reads and writes any tabular text file format including Merge, CSV, Tab-delimited, and variants. It transparently detects, reads, and preserves Unix, Mac, and/or DOS line endings and tab or comma field delimiters -- regardless of the runtime platform.
In addition to reading data files, CTable is a good way to gather, store, and operate on tabular data in memory, and to export data to delimited text files to be read by other programs or interactive productivity applications.
To achieve extremely fast data loading, CTable caches data file contents using the Storable module. This can be helpful in CGI environments or when operating on very large data files. CTable can read an entire cached table of about 120 megabytes into memory in about 10 seconds on an average mid-range computer.
For simple data-driven applications needing to store and quickly retrieve simple tabular data sets, CTable provides a credible alternative to DBM files or SQL.
For data hygiene applications, CTable forms the foundation for writing utility scripts or compilers to transfer data from external sources, such as FileMaker, Excel, Access, personal organizers, etc. into compiled or validated formats -- or even as a gateway to loading data into SQL databases or other destinations. You can easily write short, repeatable scripts in Perl to do reporting, error checking, analysis, or validation that would be hard to duplicate in less-flexible application environments.
The data representation is simple and open so you can directly access the data in the object if you feel like it -- or you can use accessors to request "clean" structures containing only the data or copies of it. Or you can build your own columns in memory and then when youre ready, turn them into a table object using the very flexible new() method.
The highly factored interface and implementation allow fine-grained subclassing so you can easily create useful lightweight subclasses. Several subclasses are included with the distribution.
Most defaults and parameters can be customized by subclassing, overridden at the instance level (avoiding the need to subclass too often), and further overridden via optional named-parameter arguments to most major method calls.
Download (0.15MB)
Added: 2007-07-13 License: Perl Artistic License Price:
833 downloads
Data::Report 0.06
Data::Report provides a framework for flexible reporting. more>>
Data::Report provides a framework for flexible reporting.
Data::Report is a flexible, plugin-driven reporting framework. It makes it easy to define reports that can be produced in text, HTML and CSV. Textual ornaments like extra empty lines, dashed lines, and cell lines can be added in a way similar to HTML style sheets.
The Data::Report framework consists of three parts:
The plugins
Plugins implement a specific type of report. Standard plugins provided are Data::Report::Plugin::Text for textual reports, Data::Report::Plugin::Html for HTML reports, and Data::Report::Plugin::Csv for CSV (comma-separated) files.
Users can, and are encouraged, to develop their own plugins to handle different styles and types of reports.
The base class
The base class Data::Report::Base implements the functionality common to all reporters, plus a number of utility functions the plugins can use.
The factory
The actual Data::Report module is a factory that creates a reporter for a given report type by selecting the appropriate plugin and returning an instance thereof.
<<lessData::Report is a flexible, plugin-driven reporting framework. It makes it easy to define reports that can be produced in text, HTML and CSV. Textual ornaments like extra empty lines, dashed lines, and cell lines can be added in a way similar to HTML style sheets.
The Data::Report framework consists of three parts:
The plugins
Plugins implement a specific type of report. Standard plugins provided are Data::Report::Plugin::Text for textual reports, Data::Report::Plugin::Html for HTML reports, and Data::Report::Plugin::Csv for CSV (comma-separated) files.
Users can, and are encouraged, to develop their own plugins to handle different styles and types of reports.
The base class
The base class Data::Report::Base implements the functionality common to all reporters, plus a number of utility functions the plugins can use.
The factory
The actual Data::Report module is a factory that creates a reporter for a given report type by selecting the appropriate plugin and returning an instance thereof.
Download (0.016MB)
Added: 2007-03-31 License: Perl Artistic License Price:
937 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 data 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