ul
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 13
uL (Microlinux) 0.2
uL (Microlinux) is a tiny linux distribution providing essential command line utilities. more>>
uL (Microlinux) is a tiny linux distribution providing essential command line utilities. The project fits in a few mega bytes and can be installed on the smallest USB pen drive or on older hard disks.
Lacking in both any X Window management and any specific, cutting edge application, Microlinux obviously does not intend to compete with more comprehensive distributions and, as a matter of fact, is not comparable even with the smaller, better built ones.
Indeed, uL can hardly be classified as distribution, as its main purpose is to serve linux almost-beginners as a tutorial, as a hands-on guide line allowing them to set up a bootable linux system in a few steps. Following the spare notes written down in the uL Guide, any interested reader will in fact be able to bring his own first, home made linux distribution to life and, even more important, to understand the inner logic of a typical linux system.
On the other side, if you have already managed to customize, install and put together linux packages, youre probably too skilled to need what Microlinux is offering. In that case, however, its uL that needs you: any practical suggestion to improve and extend its features will be highly appreciated.
How to use uL out of an USB pen drive
1. Unpack the downloaded release (tar xjf uL-x.y.tar.bz2) and copy the files to a previously FAT-formatted USB pen drive.
2. Make the pen drive bootable using the syslinux utility (http://syslinux.zytor.com) under Linux or Windows.
3. Set-up your BIOS to look first for bootable USB devices...
How to use uL out of a CDROM
1. Unpack the downloaded release (tar xjf uL-x.y.tar.bz2) and copy the files to an empty directory (lets call it cdrom).
2. Rename the file syslinux.cfg isolinux.cfg.
3. Copy the file isolinux.bin (from the above mentioned syslinux package) to the cdrom directory.
4. From the parent directory issue the command:
mkisofs -o uL.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table cdrom
5. Burn the newly created uL.iso file to a CDROM.
<<lessLacking in both any X Window management and any specific, cutting edge application, Microlinux obviously does not intend to compete with more comprehensive distributions and, as a matter of fact, is not comparable even with the smaller, better built ones.
Indeed, uL can hardly be classified as distribution, as its main purpose is to serve linux almost-beginners as a tutorial, as a hands-on guide line allowing them to set up a bootable linux system in a few steps. Following the spare notes written down in the uL Guide, any interested reader will in fact be able to bring his own first, home made linux distribution to life and, even more important, to understand the inner logic of a typical linux system.
On the other side, if you have already managed to customize, install and put together linux packages, youre probably too skilled to need what Microlinux is offering. In that case, however, its uL that needs you: any practical suggestion to improve and extend its features will be highly appreciated.
How to use uL out of an USB pen drive
1. Unpack the downloaded release (tar xjf uL-x.y.tar.bz2) and copy the files to a previously FAT-formatted USB pen drive.
2. Make the pen drive bootable using the syslinux utility (http://syslinux.zytor.com) under Linux or Windows.
3. Set-up your BIOS to look first for bootable USB devices...
How to use uL out of a CDROM
1. Unpack the downloaded release (tar xjf uL-x.y.tar.bz2) and copy the files to an empty directory (lets call it cdrom).
2. Rename the file syslinux.cfg isolinux.cfg.
3. Copy the file isolinux.bin (from the above mentioned syslinux package) to the cdrom directory.
4. From the parent directory issue the command:
mkisofs -o uL.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table cdrom
5. Burn the newly created uL.iso file to a CDROM.
Download (18.2MB)
Added: 2007-02-12 License: GPL (GNU General Public License) Price:
612 downloads
Lib3df 20030825
Lib3df is a C++ library to load 3D world. more>>
Lib3df is a C++ library to load 3D world. It works under Windows,MacOS,Linux and most Unixes.
HLIB is a C++ library intended to facilitate the use of ".MAP" files in applications. ".MAP" files are produced by the "Valve Hammer Editor" availlable at: http://collective.valve-erc.com/ . This is the editor used to create Half-Life, Team Fortress Classic, Counter-Strike and Day of Defeat maps. A lot of models are availlable in this format on the internet and the abillity to read such format may greatly help game programmer. HLIB is intended to be portable accross many platforms including: GNU/Linux, All UNIX*S, MS-Windows > 95.
HOW IT WORKS:
HLIB doesnt impose you anything about how the map data will be presented in memory. Instead the library calls the methods of a "builder" object you supplied, to inform your program that some kind of 3D objects has been found in the map file. For instance when the library finds a polygon it calls:
BeginPolygon(); then all subsequent method call will refer to this polygon.
When there is no more data about the polygon, the library calls: EndPolygon();
A map is made of many entities. Each entity can have many key-value pairs (such as: "classname" "player", which says: this entity is of class player). In addition, an entity can have some brushes. A brush is a convex set of polygons. Each polygon has:
- one texture name
- at least 3 vertex
- one normal per vertex
- one UV coordinate per vertex
First you have to create a "builder". You do this by subclassing the
HLMapBuilder class:
class MyBuilder
: public HLMapBuilder
{
public:
MyBuilder(void) {}
virtual ~MyBuilder(void) {}
}
Then you have to create an HLMap object and a builder and link them together:
HLMap theMap;
MyBuilder theBuilder
theMap.SetBuilder(theBuilder);
std::ifstream theMapFile("mymap.map");
theMap.BuildFromStream(theMapFile);
The HLMap object will parse the file and call the following methods of the builder
object:
// Cancel everything (error)
virtual void BuildError(void);
// Begins a map building
virtual void BuildBeginMap(void);
// Begins an entity building
virtual void BuildBeginEntity(void);
// Builds an option
virtual void BuildOption(const char* option, const char* value);
// Begins a brush building (an entity may have many brushes)
virtual void BuildBeginBrush(void);
// Builds a facet (deprecated)
virtual void BuildFacet(sgVec3 A, sgVec3 B, sgVec3 C, const char* texture, sgVec3 U, int ushift, sgVec3 V, int vshift, float rotation, float xscale, float yscale);
// Begins a polygon building
virtual void BuildBeginPolygon(void);
// Builds the polygons texture
virtual void BuildTexture(const char* texture);
// Get the last built texture height and width
virtual void GetTextureDimension(int* w, int* h);
// Builds one polygons vertex
virtual void BuildNormal(sgVec3 v);
// Builds one polygons vertex
virtual void BuildVertex(sgVec3 v);
// Builds the vertex UV mapping
virtual void BuildUVMapping(sgVec3 uv);
// Ends a polygon building
virtual void BuildEndPolygon(void);
// Ends a brush building (an entity may have many brushes)
virtual void BuildEndBrush(void);
// Ends an entity building
virtual void BuildEndEntity(void);
// Ends a map building
virtual void BuildEndMap(void);
Here is the list of method call produced for a map containing only a single
pyramidal object:
BuildBeginMap(); // this is a new map
BuildBeginEntity(); // this is a new entity
BuildOption("classname", "pyramid"); // this entitys classname is: "pyramid"
BuildOption("name", "The Big Pyramid"); // this entitys name is: "The Big Pyramid"
BuildBeginBrush(); // this entity contains a brush
BuildBeginPolygon(); // lets go for the brushs first polygon
BuildTexture("GoodOldPyramid"); // it uses the good old pyramid texture
GetTextureDimension(&w, &h); // the builder has to give the with and height
// of the texture
/// it is needed because the HLMap object doesnt
// know anything about image file format
BuildVertex(v); // the first vertex
BuildNormal(n); // its normal
BuildUVMapping(uv); // its UV corrdinate
BuildVertex(v); // the second vertex
BuildNormal(n); // its normal
BuildUVMapping(uv); // its UV corrdinate
...
BuildEndPolygon(); // this polygon is finished
BuildPolygon(); // The second polygon
...
BuildEndPolygon(); // the second polygon is finished
...
BuildEndBrush(); // this brush is finished
BuildBeginBrush(); // a second brush
...
BuildEndBrush(); // the second brush is finished
...
BuildEndEntity(); // The first entity is finished
BuildBeginEntity(); // a second entity
...
BuildEndEntity(); // the second entity is finished
...
BuildEndMap(); // the map is finished
HLIB contains a HLMapBuilder class which is a basic builder. It doesnt do anything but donc break anything. It is the base class for all your builder. A real life builder is given in example with the PlibMapBuilder class. It is up to you to customize these methods to produce something
usefull. HLIB is just a parser with some 3D geometry CSG calculations.
Due to the file format, HLIB has to do a lot of 3D calculation when reading the map file. To help with these calculations HLIB uses PLIB. PLIB is a 3D library availlable at: http://sourceforge.net/projects/plib
PLIB is made of many components:
- SG: which deals with geometry and is used extensively throughout HLIB
- SSG: which deals with rendering
- UL: which is a utility library, (only used in HLIB for some defines)
- ....
HLIB uses SG internally and externally: the sgVec3 type is defined by SG and is used to pass vertex data from the director (HLMap) to the builder (HLMapBuilder derived classes).
HLIB uses SSG in one class only: PlibMapBuilder. You can safely remove this class if you dont want SSG at all.
<<lessHLIB is a C++ library intended to facilitate the use of ".MAP" files in applications. ".MAP" files are produced by the "Valve Hammer Editor" availlable at: http://collective.valve-erc.com/ . This is the editor used to create Half-Life, Team Fortress Classic, Counter-Strike and Day of Defeat maps. A lot of models are availlable in this format on the internet and the abillity to read such format may greatly help game programmer. HLIB is intended to be portable accross many platforms including: GNU/Linux, All UNIX*S, MS-Windows > 95.
HOW IT WORKS:
HLIB doesnt impose you anything about how the map data will be presented in memory. Instead the library calls the methods of a "builder" object you supplied, to inform your program that some kind of 3D objects has been found in the map file. For instance when the library finds a polygon it calls:
BeginPolygon(); then all subsequent method call will refer to this polygon.
When there is no more data about the polygon, the library calls: EndPolygon();
A map is made of many entities. Each entity can have many key-value pairs (such as: "classname" "player", which says: this entity is of class player). In addition, an entity can have some brushes. A brush is a convex set of polygons. Each polygon has:
- one texture name
- at least 3 vertex
- one normal per vertex
- one UV coordinate per vertex
First you have to create a "builder". You do this by subclassing the
HLMapBuilder class:
class MyBuilder
: public HLMapBuilder
{
public:
MyBuilder(void) {}
virtual ~MyBuilder(void) {}
}
Then you have to create an HLMap object and a builder and link them together:
HLMap theMap;
MyBuilder theBuilder
theMap.SetBuilder(theBuilder);
std::ifstream theMapFile("mymap.map");
theMap.BuildFromStream(theMapFile);
The HLMap object will parse the file and call the following methods of the builder
object:
// Cancel everything (error)
virtual void BuildError(void);
// Begins a map building
virtual void BuildBeginMap(void);
// Begins an entity building
virtual void BuildBeginEntity(void);
// Builds an option
virtual void BuildOption(const char* option, const char* value);
// Begins a brush building (an entity may have many brushes)
virtual void BuildBeginBrush(void);
// Builds a facet (deprecated)
virtual void BuildFacet(sgVec3 A, sgVec3 B, sgVec3 C, const char* texture, sgVec3 U, int ushift, sgVec3 V, int vshift, float rotation, float xscale, float yscale);
// Begins a polygon building
virtual void BuildBeginPolygon(void);
// Builds the polygons texture
virtual void BuildTexture(const char* texture);
// Get the last built texture height and width
virtual void GetTextureDimension(int* w, int* h);
// Builds one polygons vertex
virtual void BuildNormal(sgVec3 v);
// Builds one polygons vertex
virtual void BuildVertex(sgVec3 v);
// Builds the vertex UV mapping
virtual void BuildUVMapping(sgVec3 uv);
// Ends a polygon building
virtual void BuildEndPolygon(void);
// Ends a brush building (an entity may have many brushes)
virtual void BuildEndBrush(void);
// Ends an entity building
virtual void BuildEndEntity(void);
// Ends a map building
virtual void BuildEndMap(void);
Here is the list of method call produced for a map containing only a single
pyramidal object:
BuildBeginMap(); // this is a new map
BuildBeginEntity(); // this is a new entity
BuildOption("classname", "pyramid"); // this entitys classname is: "pyramid"
BuildOption("name", "The Big Pyramid"); // this entitys name is: "The Big Pyramid"
BuildBeginBrush(); // this entity contains a brush
BuildBeginPolygon(); // lets go for the brushs first polygon
BuildTexture("GoodOldPyramid"); // it uses the good old pyramid texture
GetTextureDimension(&w, &h); // the builder has to give the with and height
// of the texture
/// it is needed because the HLMap object doesnt
// know anything about image file format
BuildVertex(v); // the first vertex
BuildNormal(n); // its normal
BuildUVMapping(uv); // its UV corrdinate
BuildVertex(v); // the second vertex
BuildNormal(n); // its normal
BuildUVMapping(uv); // its UV corrdinate
...
BuildEndPolygon(); // this polygon is finished
BuildPolygon(); // The second polygon
...
BuildEndPolygon(); // the second polygon is finished
...
BuildEndBrush(); // this brush is finished
BuildBeginBrush(); // a second brush
...
BuildEndBrush(); // the second brush is finished
...
BuildEndEntity(); // The first entity is finished
BuildBeginEntity(); // a second entity
...
BuildEndEntity(); // the second entity is finished
...
BuildEndMap(); // the map is finished
HLIB contains a HLMapBuilder class which is a basic builder. It doesnt do anything but donc break anything. It is the base class for all your builder. A real life builder is given in example with the PlibMapBuilder class. It is up to you to customize these methods to produce something
usefull. HLIB is just a parser with some 3D geometry CSG calculations.
Due to the file format, HLIB has to do a lot of 3D calculation when reading the map file. To help with these calculations HLIB uses PLIB. PLIB is a 3D library availlable at: http://sourceforge.net/projects/plib
PLIB is made of many components:
- SG: which deals with geometry and is used extensively throughout HLIB
- SSG: which deals with rendering
- UL: which is a utility library, (only used in HLIB for some defines)
- ....
HLIB uses SG internally and externally: the sgVec3 type is defined by SG and is used to pass vertex data from the director (HLMap) to the builder (HLMapBuilder derived classes).
HLIB uses SSG in one class only: PlibMapBuilder. You can safely remove this class if you dont want SSG at all.
Download (2.5MB)
Added: 2006-08-29 License: GPL (GNU General Public License) Price:
1152 downloads
Test::Chunks 0.39
Test::Chunks is a Data Driven Testing Framework. more>>
Test::Chunks is a Data Driven Testing Framework.
NOTE - This module has been deprecated and replaced by Test::Base. This is basically just a renaming of the module. Test::Chunks was not the best name for this module. Please discontinue using Test::Chunks and switch to Test::Base.
Helpful Hint: change all occurences of chunk to block in your test code, and everything should work exactly the same.
SYNOPSIS
use Test::Chunks;
use Pod::Simple;
delimiters qw(=== +++);
plan tests => 1 * chunks;
for my $chunk (chunks) {
# Note that this code is conceptual only. Pod::Simple is not so
# simple as to provide a simple pod_to_html function.
is(
Pod::Simple::pod_to_html($chunk->pod),
$chunk->text,
$chunk->name,
);
}
__END__
=== Header 1 Test
This is an optional description
of this particular test.
+++ pod
=head1 The Main Event
+++ html
< h1 >The Main Event< /h1 >
=== List Test
+++ pod
=over
=item * one
=item * two
=back
+++ html
< ul >
< li >one< /li >
< li >two< /li >
< /ul >
There are many testing situations where you have a set of inputs and a set of expected outputs and you want to make sure your process turns each input chunk into the corresponding output chunk. Test::Chunks allows you do this with a minimal amount of code.
<<lessNOTE - This module has been deprecated and replaced by Test::Base. This is basically just a renaming of the module. Test::Chunks was not the best name for this module. Please discontinue using Test::Chunks and switch to Test::Base.
Helpful Hint: change all occurences of chunk to block in your test code, and everything should work exactly the same.
SYNOPSIS
use Test::Chunks;
use Pod::Simple;
delimiters qw(=== +++);
plan tests => 1 * chunks;
for my $chunk (chunks) {
# Note that this code is conceptual only. Pod::Simple is not so
# simple as to provide a simple pod_to_html function.
is(
Pod::Simple::pod_to_html($chunk->pod),
$chunk->text,
$chunk->name,
);
}
__END__
=== Header 1 Test
This is an optional description
of this particular test.
+++ pod
=head1 The Main Event
+++ html
< h1 >The Main Event< /h1 >
=== List Test
+++ pod
=over
=item * one
=item * two
=back
+++ html
< ul >
< li >one< /li >
< li >two< /li >
< /ul >
There are many testing situations where you have a set of inputs and a set of expected outputs and you want to make sure your process turns each input chunk into the corresponding output chunk. Test::Chunks allows you do this with a minimal amount of code.
Download (0.032MB)
Added: 2006-06-16 License: Perl Artistic License Price:
1225 downloads
Pod::HtmlEasy 0.091
Pod::HtmlEasy Perl module can generate personalized HTML from PODs. more>>
Pod::HtmlEasy Perl module can generate personalized HTML from PODs. By default the HTML generated is similar to the CPAN site style for module documentation.
SYNOPSIS
Simple usage:
my $podhtml = Pod::HtmlEasy- >new() ;
my $html = $podhtml- >pod2html( test.pod ) ;
print "$htmln" ;
Complete usage:
use Pod::HtmlEasy ;
Create the object and set local events subs:
Note that these are all the events, and examples of how to implement
them. All of these events are, of course, already implemented, so if
the actions provided are adequate, no local subs are required.
The actual implementation of on_head1 is somewhat more complex, to
provide for the detection of the module title and insertion of the
uparrow.
my $podhtml = Pod::HtmlEasy- >new (
on_B = > sub {
my ( $this , $txt ) = @_ ;
return "< b >$txt< /b >" ;
} ,
on_C = > sub {
my ( $this , $txt ) = @_ ;
return "< font face=Courier New >$txt< /font >" ;
} ,
on_E = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s{^&}{}smx;
$txt =~ s{;$}{}smx;
$txt = qq{#$txt} if $txt =~ /^d+$/ ;
return qq{ &$txt;};
} ,
on_F = > sub {
my ( $this , $txt ) = @_ ;
return "< b >< i >$txt< /i >< /b >" ;
} ,
on_I = > sub {
my ( $this , $txt ) = @_ ;
return "< i >$txt< /i >" ;
} ,
on_L = > sub {
my ( $this , $L , $text, $page , $section, $type ) = @_ ;
if ( $type eq pod ) {
$section = defined $section ? "#$section" : ;
$page = unless defined $page;
return "< i >< a href=http://search.cpan.org/perldoc?$page$section >$text< /a >< /i >" ;
}
elsif( $type eq man ) { return "< i >$text< /i >" ;}
elsif( $type eq url ) { return "< a href=$page target=_blank >$text< /a >" ;}
} ,
on_S = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s/n/ /gs ;
return $txt ;
} ,
on_X = > sub { return ; } ,
on_Z = > sub { return ; } ,
on_back = > sub {
my $this = shift ;
return "< /ul >$NL" ;
} ,
on_begin = > sub {
my $this = shift ;
my ( $txt , $a_name ) = @_ ;
$this- >{IN_BEGIN} = 1;
return ;
} ,
on_error = > sub {
my ( $this , $txt ) = @_ ;
return qq{< !-- POD_ERROR: $txt -- >} ;
} ,
on_end = > sub {
my $this = shift ;
my ( $txt , $a_name ) = @_ ;
delete $this- >{IN_BEGIN};
return ;
} ,
on_for = > sub { return ;} ,
on_head1 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h1 >$txt< /h1 >$NL$NL} ;
} ,
on_head2 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h2 >$txt< /h2 >$NL$NL} ;
} ,
on_head3 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h3 >$txt< /h3 >$NL$NL} ;
} ,
on_head4 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h4 >$txt< /h4 >$NL$NL} ;
} ,
on_include = > sub {
my ( $this , $file ) = @_ ;
return qq{./$file} ;
} ,
on_item = > sub {
my ( $this , $txt ) = @_ ;
return qq{< li >$txt< /li >$NL} ;
} ,
on_index_node_start = > sub {
my ( $this , $txt , $a_name , $has_children ) = @_ ;
my $ret = qq{< li >< a href=#$a_name >$txt< /a >$NL} ;
$ret .= q{$NL< ul >$NL} if $has_children ;
return $ret ;
} ,
on_index_node_end = > sub {
my $this = shift ;
my ( $txt , $a_name , $has_children ) = @_ ;
my $ret = $has_children ? q{< /ul >} : $EMPTY ;
return $ret ;
} ,
on_over = > sub {
my ( $this , $level ) = @_ ;
return qq{< ul >$NL? ;
} ,
on_textblock = > sub {
my ( $this , $txt ) = @_ ;
return if exists $this- >{IN_BEGIN};
return qq{< p >$txt< /p >$NL} ;
} ,
on_uri = > sub {
my ( $this , $uri ) = @_ ;
return qq{< a href=$uri target=_blank >$uri< /a >{ ;
} ,
on_verbatim = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s{(A$NL)*(A$NL)z}{}gsmx;
return unless length $txt;
return qq{< pre >$txt< /pre >$NL} ;
} ,
) ;
## Convert to HTML:
my $html = $podhtml- >pod2html(test.pod ,
test.html ,
title = > POD::Test ,
body = > { bgcolor = > #CCCCCC } ,
css = > test.css ,
) ;
<<lessSYNOPSIS
Simple usage:
my $podhtml = Pod::HtmlEasy- >new() ;
my $html = $podhtml- >pod2html( test.pod ) ;
print "$htmln" ;
Complete usage:
use Pod::HtmlEasy ;
Create the object and set local events subs:
Note that these are all the events, and examples of how to implement
them. All of these events are, of course, already implemented, so if
the actions provided are adequate, no local subs are required.
The actual implementation of on_head1 is somewhat more complex, to
provide for the detection of the module title and insertion of the
uparrow.
my $podhtml = Pod::HtmlEasy- >new (
on_B = > sub {
my ( $this , $txt ) = @_ ;
return "< b >$txt< /b >" ;
} ,
on_C = > sub {
my ( $this , $txt ) = @_ ;
return "< font face=Courier New >$txt< /font >" ;
} ,
on_E = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s{^&}{}smx;
$txt =~ s{;$}{}smx;
$txt = qq{#$txt} if $txt =~ /^d+$/ ;
return qq{ &$txt;};
} ,
on_F = > sub {
my ( $this , $txt ) = @_ ;
return "< b >< i >$txt< /i >< /b >" ;
} ,
on_I = > sub {
my ( $this , $txt ) = @_ ;
return "< i >$txt< /i >" ;
} ,
on_L = > sub {
my ( $this , $L , $text, $page , $section, $type ) = @_ ;
if ( $type eq pod ) {
$section = defined $section ? "#$section" : ;
$page = unless defined $page;
return "< i >< a href=http://search.cpan.org/perldoc?$page$section >$text< /a >< /i >" ;
}
elsif( $type eq man ) { return "< i >$text< /i >" ;}
elsif( $type eq url ) { return "< a href=$page target=_blank >$text< /a >" ;}
} ,
on_S = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s/n/ /gs ;
return $txt ;
} ,
on_X = > sub { return ; } ,
on_Z = > sub { return ; } ,
on_back = > sub {
my $this = shift ;
return "< /ul >$NL" ;
} ,
on_begin = > sub {
my $this = shift ;
my ( $txt , $a_name ) = @_ ;
$this- >{IN_BEGIN} = 1;
return ;
} ,
on_error = > sub {
my ( $this , $txt ) = @_ ;
return qq{< !-- POD_ERROR: $txt -- >} ;
} ,
on_end = > sub {
my $this = shift ;
my ( $txt , $a_name ) = @_ ;
delete $this- >{IN_BEGIN};
return ;
} ,
on_for = > sub { return ;} ,
on_head1 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h1 >$txt< /h1 >$NL$NL} ;
} ,
on_head2 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h2 >$txt< /h2 >$NL$NL} ;
} ,
on_head3 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h3 >$txt< /h3 >$NL$NL} ;
} ,
on_head4 = > sub {
my ( $this , $txt , $a_name ) = @_ ;
return qq{< a name=$a_name >< /a >< h4 >$txt< /h4 >$NL$NL} ;
} ,
on_include = > sub {
my ( $this , $file ) = @_ ;
return qq{./$file} ;
} ,
on_item = > sub {
my ( $this , $txt ) = @_ ;
return qq{< li >$txt< /li >$NL} ;
} ,
on_index_node_start = > sub {
my ( $this , $txt , $a_name , $has_children ) = @_ ;
my $ret = qq{< li >< a href=#$a_name >$txt< /a >$NL} ;
$ret .= q{$NL< ul >$NL} if $has_children ;
return $ret ;
} ,
on_index_node_end = > sub {
my $this = shift ;
my ( $txt , $a_name , $has_children ) = @_ ;
my $ret = $has_children ? q{< /ul >} : $EMPTY ;
return $ret ;
} ,
on_over = > sub {
my ( $this , $level ) = @_ ;
return qq{< ul >$NL? ;
} ,
on_textblock = > sub {
my ( $this , $txt ) = @_ ;
return if exists $this- >{IN_BEGIN};
return qq{< p >$txt< /p >$NL} ;
} ,
on_uri = > sub {
my ( $this , $uri ) = @_ ;
return qq{< a href=$uri target=_blank >$uri< /a >{ ;
} ,
on_verbatim = > sub {
my ( $this , $txt ) = @_ ;
$txt =~ s{(A$NL)*(A$NL)z}{}gsmx;
return unless length $txt;
return qq{< pre >$txt< /pre >$NL} ;
} ,
) ;
## Convert to HTML:
my $html = $podhtml- >pod2html(test.pod ,
test.html ,
title = > POD::Test ,
body = > { bgcolor = > #CCCCCC } ,
css = > test.css ,
) ;
Download (0.025MB)
Added: 2007-07-23 License: Perl Artistic License Price:
823 downloads
HTML::WikiConverter::MediaWiki 0.55
HTML::WikiConverter::MediaWiki is a Perl module used to convert HTML to MediaWiki markup. more>>
HTML::WikiConverter::MediaWiki is a Perl module used to convert HTML to MediaWiki markup.
SYNOPSIS
use HTML::WikiConverter;
my $wc = new HTML::WikiConverter( dialect => MediaWiki );
print $wc->html2wiki( $html );
This module contains rules for converting HTML into MediaWiki markup. See HTML::WikiConverter for additional usage details.
ATTRIBUTES
In addition to the regular set of attributes recognized by the HTML::WikiConverter constructor, this dialect also accepts the following attributes:
preserve_bold
Boolean indicating whether bold HTML elements should be preserved as HTML in the wiki output rather than being converted into MediaWiki markup.
By default, < b > and < strong > elements are converted to wiki markup identically. But sometimes you may wish tags in the HTML to be preserved in the resulting MediaWiki markup. This attribute allows this.
For example, if preserve_bold is enabled, HTML like
< ul >
< li > < b >Bold< /b >
< li > < strong >Strong< /strong >
< /ul >
will be converted to
* < b >Bold< /b >
* Strong
When disabled (the default), the preceding HTML markup would be converted into
* Bold
* Strong
preserve_italic
Boolean indicating whether italic HTML elements should be preserved as HTML in the wiki output rather than being converted into MediaWiki markup.
For example, if preserve_italic is enabled, HTML like
< ul >
< li > < i >Italic< /i >
< li > < em >Emphasized< /em >
< /ul >
will be converted to
* < i >Italic< /i >
* Emphasized
When disabled (the default), the preceding HTML markup would be converted into
* Italic
* Emphasized
preserve_templates
Boolean indicating whether {{template}} calls found in HTML should be preserved in the wiki markup. If disabled (the default), templates calls will be wrapped in < nowiki > tags.
preserve_nowiki
Boolean indicating whether tags found in HTML should be preserved in the wiki markup. If disabled (the default), nowiki tags will be replaced with their content.
pad_headings
Boolean indicating whether section headings should be padded with spaces (eg, "== Section ==" instead of "==Section=="). Default is to pad.
<<lessSYNOPSIS
use HTML::WikiConverter;
my $wc = new HTML::WikiConverter( dialect => MediaWiki );
print $wc->html2wiki( $html );
This module contains rules for converting HTML into MediaWiki markup. See HTML::WikiConverter for additional usage details.
ATTRIBUTES
In addition to the regular set of attributes recognized by the HTML::WikiConverter constructor, this dialect also accepts the following attributes:
preserve_bold
Boolean indicating whether bold HTML elements should be preserved as HTML in the wiki output rather than being converted into MediaWiki markup.
By default, < b > and < strong > elements are converted to wiki markup identically. But sometimes you may wish tags in the HTML to be preserved in the resulting MediaWiki markup. This attribute allows this.
For example, if preserve_bold is enabled, HTML like
< ul >
< li > < b >Bold< /b >
< li > < strong >Strong< /strong >
< /ul >
will be converted to
* < b >Bold< /b >
* Strong
When disabled (the default), the preceding HTML markup would be converted into
* Bold
* Strong
preserve_italic
Boolean indicating whether italic HTML elements should be preserved as HTML in the wiki output rather than being converted into MediaWiki markup.
For example, if preserve_italic is enabled, HTML like
< ul >
< li > < i >Italic< /i >
< li > < em >Emphasized< /em >
< /ul >
will be converted to
* < i >Italic< /i >
* Emphasized
When disabled (the default), the preceding HTML markup would be converted into
* Italic
* Emphasized
preserve_templates
Boolean indicating whether {{template}} calls found in HTML should be preserved in the wiki markup. If disabled (the default), templates calls will be wrapped in < nowiki > tags.
preserve_nowiki
Boolean indicating whether tags found in HTML should be preserved in the wiki markup. If disabled (the default), nowiki tags will be replaced with their content.
pad_headings
Boolean indicating whether section headings should be padded with spaces (eg, "== Section ==" instead of "==Section=="). Default is to pad.
Download (0.011MB)
Added: 2007-07-18 License: Perl Artistic License Price:
832 downloads
OpenInteract2::TT2::Plugin 1.99_06
OpenInteract2::TT2::Plugin is a Perl module for custom OpenInteract functionality in templates. more>>
OpenInteract2::TT2::Plugin is a Perl module for custom OpenInteract functionality in templates.
SYNOPSIS
# Create the TT object with the OI plugin
my $template = Template->new(
PLUGINS => { OI => OpenInteract2::TT2::Plugin }, ... );
my ( $output );
$template->process( package::template, %params, $output );
# In the template (brief examples, see below for more)
Here is what the plugin can do:
< ul>< li>[% OI.show_all_actions.join( "n < li>" ) -%]< /ul>
Here are plugins available to you:
[% OI.show_all_plugins.keys.sort.join( , ) %]
Here are all the parameters passed to the request:
[% OI.request_param.sort.join( , ) %]
And the value of a particular parameter:
last name: [% OI.request_param( last_name ) %]
[% OI.action_execute( error_display, error_msg = error_msg ) -%]
# Note that you can also use the MSG function
[% OI.msg( mypage.intro, OI.login.full_name ) %]
# Note that you can also use the LH variable
[% mh = OI.msg_handle %]
[% mh.maketext( mypage.intro, OI.login.full_name ) %]
[% mh.maketext( mypage.learnmore ) %]
[% OI.box_add( contact_tools_box, title = Contact Tools,
weight = 2 ) -%]
[% object_info = OI.object_description( object ) %]
This is a [% object_info.name %] object.
Is the object in the class?
[% OI.class_isa( object, SPOPS::DBI ) ? yes : no %]
Is the SPOPS object writable?
[% IF OI.can_write( object ) %]Youre special![% END %]
[% action = OI.action %]
Action that called this template: [% action.name %]
Security for action:
[% action.security_level %] found,
[% action.security_required %] required
Properties of action:
[% action_prop = action.properties %]
[% FOREACH key = action_prop.keys %]
[% key %] = [% action_prop.$key %]
[% END %]
Parameters of action:
[% action_param = action.param %]
[% FOREACH key = action_param.keys %]
[% key %] = [% action_param.$key %]
[% END %]
Today is [% OI.date_format( now, %Y-%m-%d %l:%M %p ) %] the
[% OI.date_format( now, %j ) %] day of the year
[% d = OI.date_into_object( object.updated_on, %Y-%m-%d ) -%]
[% OI.action_execute( date_select, month_value = d.month,
day_value = d.day,
year_value = d.year, blank = 1,
field_prefix = updated_on ) -%]
[% INCLUDE form_checkbox( name = is_in_print,
value = TRUE,
is_checked = OI.as_boolean( book.is_in_print ) ) -%]
Is in print? [% OI.as_boolean_label( book.is_in_print ) %]
Is in print? [% OI.as_boolean_label( book.is_in_print, You betcha, No way ) %]
[% OI.limit_string( object.description, 30 ) %]
var person_last_name = [% OI.javascript_quote( person.last_name ) %];
[% OI.limit_sentences( news.news_item, 3 ) %]
[% score = grade.score / test.total %]
Your grade is: [% OI.percent_format( score ) %]
You have [% OI.money_format( account.balance ) %] left to spend.
Hello [% OI.uc_first( person.first_name ) %]
You are important so I must speak to you loudly [% OI.uc( person.last_name ) %]
Item: [% OI.html_decode( news.news_item ) %]
# Add parameters to an existing URL
[% display_no_template_url = OI.add_params_to_url( my_path, no_template = yes ) %]
# Works, but not as useful...
[% edit_url = OI.make_url( BASE = /User/show/, user_id = OI.login.user_id,
edit = 1, show_all = yes ) %]
# Preferred way to generate URLs for actions
[% edit_url = OI.make_url( ACTION = user, TASK = show,
user_id = OI.login.user_id,
edit = 1, show_all = yes ) %]
[% image_url = OI.make_url( IMAGE = /images/foo.gif ) %]
[% static_url = OI.make_url( STATIC = /generated/report-q1-2003.pdf ) %]
[% theme = OI.theme_properties %]
Background color of page: [% theme.bgcolor %]
[% new_theme = OI.theme_fetch( 5 ) %]
Background color of page from other theme: [% new_theme.bgcolor %]
[% IF OI.logged_in -%]
Hello [% OI.login.full_name %].
Your groups are: [% OI.login_group.join( , ) -%]
[% ELSE -%]
You are not logged in.
[% END -%]
Your last search: [% OI.session.latest_search %]
< a href="[% OI.return_url %]">Refresh< /a>
[% IF object.tmp_security_level >= OI.security_level.write -%]
you can edit this object!
[% END %]
<<lessSYNOPSIS
# Create the TT object with the OI plugin
my $template = Template->new(
PLUGINS => { OI => OpenInteract2::TT2::Plugin }, ... );
my ( $output );
$template->process( package::template, %params, $output );
# In the template (brief examples, see below for more)
Here is what the plugin can do:
< ul>< li>[% OI.show_all_actions.join( "n < li>" ) -%]< /ul>
Here are plugins available to you:
[% OI.show_all_plugins.keys.sort.join( , ) %]
Here are all the parameters passed to the request:
[% OI.request_param.sort.join( , ) %]
And the value of a particular parameter:
last name: [% OI.request_param( last_name ) %]
[% OI.action_execute( error_display, error_msg = error_msg ) -%]
# Note that you can also use the MSG function
[% OI.msg( mypage.intro, OI.login.full_name ) %]
# Note that you can also use the LH variable
[% mh = OI.msg_handle %]
[% mh.maketext( mypage.intro, OI.login.full_name ) %]
[% mh.maketext( mypage.learnmore ) %]
[% OI.box_add( contact_tools_box, title = Contact Tools,
weight = 2 ) -%]
[% object_info = OI.object_description( object ) %]
This is a [% object_info.name %] object.
Is the object in the class?
[% OI.class_isa( object, SPOPS::DBI ) ? yes : no %]
Is the SPOPS object writable?
[% IF OI.can_write( object ) %]Youre special![% END %]
[% action = OI.action %]
Action that called this template: [% action.name %]
Security for action:
[% action.security_level %] found,
[% action.security_required %] required
Properties of action:
[% action_prop = action.properties %]
[% FOREACH key = action_prop.keys %]
[% key %] = [% action_prop.$key %]
[% END %]
Parameters of action:
[% action_param = action.param %]
[% FOREACH key = action_param.keys %]
[% key %] = [% action_param.$key %]
[% END %]
Today is [% OI.date_format( now, %Y-%m-%d %l:%M %p ) %] the
[% OI.date_format( now, %j ) %] day of the year
[% d = OI.date_into_object( object.updated_on, %Y-%m-%d ) -%]
[% OI.action_execute( date_select, month_value = d.month,
day_value = d.day,
year_value = d.year, blank = 1,
field_prefix = updated_on ) -%]
[% INCLUDE form_checkbox( name = is_in_print,
value = TRUE,
is_checked = OI.as_boolean( book.is_in_print ) ) -%]
Is in print? [% OI.as_boolean_label( book.is_in_print ) %]
Is in print? [% OI.as_boolean_label( book.is_in_print, You betcha, No way ) %]
[% OI.limit_string( object.description, 30 ) %]
var person_last_name = [% OI.javascript_quote( person.last_name ) %];
[% OI.limit_sentences( news.news_item, 3 ) %]
[% score = grade.score / test.total %]
Your grade is: [% OI.percent_format( score ) %]
You have [% OI.money_format( account.balance ) %] left to spend.
Hello [% OI.uc_first( person.first_name ) %]
You are important so I must speak to you loudly [% OI.uc( person.last_name ) %]
Item: [% OI.html_decode( news.news_item ) %]
# Add parameters to an existing URL
[% display_no_template_url = OI.add_params_to_url( my_path, no_template = yes ) %]
# Works, but not as useful...
[% edit_url = OI.make_url( BASE = /User/show/, user_id = OI.login.user_id,
edit = 1, show_all = yes ) %]
# Preferred way to generate URLs for actions
[% edit_url = OI.make_url( ACTION = user, TASK = show,
user_id = OI.login.user_id,
edit = 1, show_all = yes ) %]
[% image_url = OI.make_url( IMAGE = /images/foo.gif ) %]
[% static_url = OI.make_url( STATIC = /generated/report-q1-2003.pdf ) %]
[% theme = OI.theme_properties %]
Background color of page: [% theme.bgcolor %]
[% new_theme = OI.theme_fetch( 5 ) %]
Background color of page from other theme: [% new_theme.bgcolor %]
[% IF OI.logged_in -%]
Hello [% OI.login.full_name %].
Your groups are: [% OI.login_group.join( , ) -%]
[% ELSE -%]
You are not logged in.
[% END -%]
Your last search: [% OI.session.latest_search %]
< a href="[% OI.return_url %]">Refresh< /a>
[% IF object.tmp_security_level >= OI.security_level.write -%]
you can edit this object!
[% END %]
Download (0.91MB)
Added: 2006-12-14 License: Perl Artistic License Price:
1044 downloads
Wiki::Toolkit::Formatter::Mediawiki 0.02
Wiki::Toolkit::Formatter::Mediawiki is a Mediawiki-style formatter for Wiki::Toolkit. more>>
Wiki::Toolkit::Formatter::Mediawiki is a Mediawiki-style formatter for Wiki::Toolkit.
SYNOPSIS
This package implements a formatter for the Wiki::Toolkit module which attempts to duplicate the behavior of the Mediawiki application (a set of PHP scripts used by Wikipedia and friends).
use Wiki::Toolkit
use Wiki::Toolkit::Store::Mediawiki;
use Wiki::Toolkit::Formatter::Mediawiki;
my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
# See below for parameter details.
my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new (%config,
store => $store);
my $wiki = Wiki::Toolkit->new (store => $store,
formatter => $formatter);
METHODS
new
my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new
(allowed_tags => [# HTML
qw(b big blockquote br caption center cite code dd
div dl dt em font h1 h2 h3 h4 h5 h6 hr i li ol p
pre rb rp rt ruby s small strike strong sub sup
table td th tr tt u ul var),
# MediaWiki Specific
qw(nowiki),],
allowed_attrs => [qw(title align lang dir width height bgcolor),
qw(clear), # BR
qw(noshade), # HR
qw(cite), # BLOCKQUOTE, Q
qw(size face color), # FONT
# For various lists, mostly deprecated but
# safe
qw(type start value compact),
# Tables
qw(summary width border frame rules
cellspacing cellpadding valign char
charoff colgroup col span abbr axis
headers scope rowspan colspan),
qw(id class name style), # For CSS
],
node_prefix => ,
store => $store);
Parameters will default to the values above, with the exception of store, which is a required argument without a default. store does not have to be of type Wiki::Toolkit::Store::Mediawiki.
format
my $html = $formatter->format ($content);
Escapes any tags which werent specified as allowed on creation, then interpolates any macros, then calls Text::WikiFormat::format (with the specialized Mediawiki config) to translate the raw Wiki language supplied into HTML.
find_internal_links
my @links_to = $formatter->find_internal_links ($content);
Returns a list of all nodes that the supplied content links to.
<<lessSYNOPSIS
This package implements a formatter for the Wiki::Toolkit module which attempts to duplicate the behavior of the Mediawiki application (a set of PHP scripts used by Wikipedia and friends).
use Wiki::Toolkit
use Wiki::Toolkit::Store::Mediawiki;
use Wiki::Toolkit::Formatter::Mediawiki;
my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
# See below for parameter details.
my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new (%config,
store => $store);
my $wiki = Wiki::Toolkit->new (store => $store,
formatter => $formatter);
METHODS
new
my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new
(allowed_tags => [# HTML
qw(b big blockquote br caption center cite code dd
div dl dt em font h1 h2 h3 h4 h5 h6 hr i li ol p
pre rb rp rt ruby s small strike strong sub sup
table td th tr tt u ul var),
# MediaWiki Specific
qw(nowiki),],
allowed_attrs => [qw(title align lang dir width height bgcolor),
qw(clear), # BR
qw(noshade), # HR
qw(cite), # BLOCKQUOTE, Q
qw(size face color), # FONT
# For various lists, mostly deprecated but
# safe
qw(type start value compact),
# Tables
qw(summary width border frame rules
cellspacing cellpadding valign char
charoff colgroup col span abbr axis
headers scope rowspan colspan),
qw(id class name style), # For CSS
],
node_prefix => ,
store => $store);
Parameters will default to the values above, with the exception of store, which is a required argument without a default. store does not have to be of type Wiki::Toolkit::Store::Mediawiki.
format
my $html = $formatter->format ($content);
Escapes any tags which werent specified as allowed on creation, then interpolates any macros, then calls Text::WikiFormat::format (with the specialized Mediawiki config) to translate the raw Wiki language supplied into HTML.
find_internal_links
my @links_to = $formatter->find_internal_links ($content);
Returns a list of all nodes that the supplied content links to.
Download (0.006MB)
Added: 2007-04-02 License: Perl Artistic License Price:
936 downloads
Mowyw 0.4.0
Mowyw is a command line driven offline CMS that processes html files with a few special syntax elements. more>>
Mowyw is a command line driven offline CMS that processes html files with a few special syntax elements.
Think of it as a kind of preprocessor system specifically designed for web pages.
Mowyw uses very simple syntax and needs very little time to get used to.
mowyw is written in Perl for Linux and other POSIX compliant systems, but it should work on all platforms that perl runs on, perhaps with slight modifications. It is Open Source Software (GPL) and free of any charge.
What is it not?
mowyw is not an online CMS with a web frontend, sql backend, guestbook and other "fancy" stuff.
Syntax Example
Entire files can be included via the [[include name]] directive.
A menu foo can be included with the item bar as the active item via [[menu foo bar]]. The corresponding menu file might look like this:
< h2 >Navigation< /h2 >
< ul >
[[item bar < li >< a href="bar" {{class="active"}}>Bar< /a >< /li >]]
[[item baz < li >< a href="baz" {{class="active"}}>BaZ< /a >< /li >]]
< /ul >
Where the parts between double braces {{ ... }} only appear in the final file if the menu was called with the matching label.
Enhancements:
- Additional Syntax [% ... %] for tags.
<<lessThink of it as a kind of preprocessor system specifically designed for web pages.
Mowyw uses very simple syntax and needs very little time to get used to.
mowyw is written in Perl for Linux and other POSIX compliant systems, but it should work on all platforms that perl runs on, perhaps with slight modifications. It is Open Source Software (GPL) and free of any charge.
What is it not?
mowyw is not an online CMS with a web frontend, sql backend, guestbook and other "fancy" stuff.
Syntax Example
Entire files can be included via the [[include name]] directive.
A menu foo can be included with the item bar as the active item via [[menu foo bar]]. The corresponding menu file might look like this:
< h2 >Navigation< /h2 >
< ul >
[[item bar < li >< a href="bar" {{class="active"}}>Bar< /a >< /li >]]
[[item baz < li >< a href="baz" {{class="active"}}>BaZ< /a >< /li >]]
< /ul >
Where the parts between double braces {{ ... }} only appear in the final file if the menu was called with the matching label.
Enhancements:
- Additional Syntax [% ... %] for tags.
Download (0.011MB)
Added: 2007-06-07 License: GPL (GNU General Public License) Price:
869 downloads
Text::Scraper 0.02
Text::Scraper contains structured data from (un)structured text. more>>
Text::Scraper contains structured data from (un)structured text.
SYNOPSIS
use Text::Scraper;
use LWP::Simple;
use Data::Dumper;
#
# 1. Get our template and source text
#
my $tmpl = Text::Scraper->slurp(*DATA);
my $src = get(http://search.cpan.org/recent) || die $!;
#
# 2. Extract data from source
#
my $obj = Text::Scraper->new(tmpl => $tmpl);
my $data = $obj->scrape($src);
#
# 3. Do something really neat...(left as excercise)
#
print "Newest Submission: ", $data->[0]{submissions}[0]{name}, "nn";
print "Scraper model:n", Dumper($obj), "nn";
print "Parsed model:n", Dumper($data) , "nn";
__DATA__
< div class=path>< center>< table>< tr>
< ?tmpl stuff pre_nav ?>
< td class=datecell>< span>< big>< b> < ?tmpl var date_string ?> < /b>< /big>< /span>< /td>
< ?tmpl stuff post_nav ?>
< /tr>< /table>< /center>< /div>
< ul>
< ?tmpl loop submissions ?>
< li>< a href="< ?tmpl var link ?>">< ?tmpl var name ?>< /a>
< ?tmpl if has_description ?>
< small> -- < ?tmpl var description ?>< /small>
< ?tmpl end has_description ?>
< /li>
< ?tmpl end submissions ?>
< /ul>
ABSTRACT
Text::Scraper provides a fully functional base-class to quickly develop Screen-Scrapers and other text extraction tools. Programmatically generated text such as dynamic webpages are trivially reversed engineered.
Using templates, the programmer is freed from staring at fragile, heavily escaped regular expressions, mapping capture groups to named variables or wrestling with the DOM and badly formed HTML. In addition, extracted data can be hierarchical, which is beyond the capabilities of vanilla regular expressions.
Text::Scrapers functionality overlaps some existing CPAN modules - Template::Extract and WWW::Scraper.
Text::Scraper is much more lightweight than either and has a more general application domain than the latter. It has no dependencies on other frameworks, modules or design-decisions. On average, Text::Scraper benchmarks around 250% faster than Template::Extract - and uses significantly less memory.
Unlike both existing modules, Text::Scraper generalizes its functionality to allow the programmer to refine template capture groups beyond (.*?), fully redefine the template syntax and introduce new template constructs bound to custom classes.
<<lessSYNOPSIS
use Text::Scraper;
use LWP::Simple;
use Data::Dumper;
#
# 1. Get our template and source text
#
my $tmpl = Text::Scraper->slurp(*DATA);
my $src = get(http://search.cpan.org/recent) || die $!;
#
# 2. Extract data from source
#
my $obj = Text::Scraper->new(tmpl => $tmpl);
my $data = $obj->scrape($src);
#
# 3. Do something really neat...(left as excercise)
#
print "Newest Submission: ", $data->[0]{submissions}[0]{name}, "nn";
print "Scraper model:n", Dumper($obj), "nn";
print "Parsed model:n", Dumper($data) , "nn";
__DATA__
< div class=path>< center>< table>< tr>
< ?tmpl stuff pre_nav ?>
< td class=datecell>< span>< big>< b> < ?tmpl var date_string ?> < /b>< /big>< /span>< /td>
< ?tmpl stuff post_nav ?>
< /tr>< /table>< /center>< /div>
< ul>
< ?tmpl loop submissions ?>
< li>< a href="< ?tmpl var link ?>">< ?tmpl var name ?>< /a>
< ?tmpl if has_description ?>
< small> -- < ?tmpl var description ?>< /small>
< ?tmpl end has_description ?>
< /li>
< ?tmpl end submissions ?>
< /ul>
ABSTRACT
Text::Scraper provides a fully functional base-class to quickly develop Screen-Scrapers and other text extraction tools. Programmatically generated text such as dynamic webpages are trivially reversed engineered.
Using templates, the programmer is freed from staring at fragile, heavily escaped regular expressions, mapping capture groups to named variables or wrestling with the DOM and badly formed HTML. In addition, extracted data can be hierarchical, which is beyond the capabilities of vanilla regular expressions.
Text::Scrapers functionality overlaps some existing CPAN modules - Template::Extract and WWW::Scraper.
Text::Scraper is much more lightweight than either and has a more general application domain than the latter. It has no dependencies on other frameworks, modules or design-decisions. On average, Text::Scraper benchmarks around 250% faster than Template::Extract - and uses significantly less memory.
Unlike both existing modules, Text::Scraper generalizes its functionality to allow the programmer to refine template capture groups beyond (.*?), fully redefine the template syntax and introduce new template constructs bound to custom classes.
Download (0.045MB)
Added: 2007-08-22 License: Perl Artistic License Price:
796 downloads
TCPDF 1.53.0.TC033 (PHP4)
TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. more>>
TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions.
TCPDF is an extension and improvement of the FPDF class that supports UTF-8, Unicode, HTML, and barcodes.
Main features:
- supports all ISO page formats;
- supports UTF-8 Unicode;
- includes methods to publish some xhtml code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;
- includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/)
- supports TrueTypeUnicode, TrueType, Type1 and encoding;
- supports custom page formats, margins and units of measure;
- includes methods for page header and footer management;
- supports automatic page break;
- supports automatic page numbering;
- supports automatic line break and text justification;
- supports JPEG and PNG images;
- supports colors;
- supports links;
- support page compression (require zlib extension: http://www.gzip.org/zlib/);
- the source code is full documented in PhpDocumentor Style
Enhancements:
- fixed bug 1762550: case sensitive for font files
- NOTE: all fonts files names must be in lowercase!
<<lessTCPDF is an extension and improvement of the FPDF class that supports UTF-8, Unicode, HTML, and barcodes.
Main features:
- supports all ISO page formats;
- supports UTF-8 Unicode;
- includes methods to publish some xhtml code, supporting the following elements: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small;
- includes a method to print various barcode formats using an improved version of "Generic Barcode Render Class" by Karim Mribti (http://www.mribti.com/barcode/) (require GD library: http://www.boutell.com/gd/)
- supports TrueTypeUnicode, TrueType, Type1 and encoding;
- supports custom page formats, margins and units of measure;
- includes methods for page header and footer management;
- supports automatic page break;
- supports automatic page numbering;
- supports automatic line break and text justification;
- supports JPEG and PNG images;
- supports colors;
- supports links;
- support page compression (require zlib extension: http://www.gzip.org/zlib/);
- the source code is full documented in PhpDocumentor Style
Enhancements:
- fixed bug 1762550: case sensitive for font files
- NOTE: all fonts files names must be in lowercase!
Download (3.7MB)
Added: 2007-08-01 License: LGPL (GNU Lesser General Public License) Price:
823 downloads
Other version of TCPDF 1.53.0.TC033
License:GPL (GNU General Public License)
Sybase::RepAgent 0.03
Sybase::RepAgent is a Perl extension for building a Sybase Replication Agent which talks to a Sybase Replication Server. more>>
Sybase::RepAgent is a Perl extension for building a Sybase Replication Agent which talks to a Sybase Replication Server.
SYNOPSIS
use Sybase::RepAgent;
my $ra = Sybase::RepAgent->new($repserver,
$user,
password,
$dataserver,
$database,
$ltl_version);
$ra->distribute(%command_tags, $subcommand);
$ra->begin_tran();
$ra->commit_tran();
$ra->rollback_tran();
$ra->insert();
$ra->update();
$ra->delete();
my $mu = $ra->maintenance_user;
my $tp = $ra->truncation_pointer;
my $lv = $ra->ltl_version;
my $sv = $ra->system_version;
my $ul = $ra->upgrade_locator;
my $last_oqid = $ra->last_oqid;
my $last_tran_id = $ra->last_tran_id;
Sybase Replication Server is a mighty tool for data distribution, mirroring, warm stand by and a lot more. RepServer gets the data to distribut from a Replication Agent, which is built into the Sybase database server. RepAgents exit for all major databases and the language which is used by RepAgent to RepServer is described in the Replication Server Design Guide at the Sybase web site.
This module is just a wrapper around this language which allows you to roll your own RepAgent. You can use it to enable replication in a database which is not supported by Sybase (e.g. MySQL and PostgreSQL, which both support Perl-Procedures by now). Or you can use it to feed data into RepServer, which will do the distribution, error handling and all that stuff.
For setting up and using a replication with Sybase::RepAgent see the RepAgent cookbook (cookbook.pm).
This is my own work. Sybase Inc. is in no way involved and does NOT support this module.
<<lessSYNOPSIS
use Sybase::RepAgent;
my $ra = Sybase::RepAgent->new($repserver,
$user,
password,
$dataserver,
$database,
$ltl_version);
$ra->distribute(%command_tags, $subcommand);
$ra->begin_tran();
$ra->commit_tran();
$ra->rollback_tran();
$ra->insert();
$ra->update();
$ra->delete();
my $mu = $ra->maintenance_user;
my $tp = $ra->truncation_pointer;
my $lv = $ra->ltl_version;
my $sv = $ra->system_version;
my $ul = $ra->upgrade_locator;
my $last_oqid = $ra->last_oqid;
my $last_tran_id = $ra->last_tran_id;
Sybase Replication Server is a mighty tool for data distribution, mirroring, warm stand by and a lot more. RepServer gets the data to distribut from a Replication Agent, which is built into the Sybase database server. RepAgents exit for all major databases and the language which is used by RepAgent to RepServer is described in the Replication Server Design Guide at the Sybase web site.
This module is just a wrapper around this language which allows you to roll your own RepAgent. You can use it to enable replication in a database which is not supported by Sybase (e.g. MySQL and PostgreSQL, which both support Perl-Procedures by now). Or you can use it to feed data into RepServer, which will do the distribution, error handling and all that stuff.
For setting up and using a replication with Sybase::RepAgent see the RepAgent cookbook (cookbook.pm).
This is my own work. Sybase Inc. is in no way involved and does NOT support this module.
Download (0.012MB)
Added: 2006-06-13 License: Perl Artistic License Price:
1231 downloads
RTF::Writer 1.11
RTF::Writer is a Perl module for generating documents in Rich Text Format. more>>
RTF::Writer is a Perl module for generating documents in Rich Text Format.
SYNOPSIS
use RTF::Writer;
my $rtf = RTF::Writer->new_to_file("greetings.rtf");
$rtf->prolog( title => "Greetings, hyoomon" );
$rtf->number_pages;
$rtf->paragraph(
fs40bi, # 20pt, bold, italic
"Hi there!"
);
$rtf->close;
This module is a class; an object belonging to this class acts like an output filehandle, and calling methods on it causes RTF text to be written.
Incidentally, this module also exports a few useful functions, upon request.
METHODS
$h = RTF::Writer->new_to_file($filename);
This creates a new RTF output stream object, such that sending text to this object will write to the filespec given. This is basically a wrapper around new_to_handle. If opening a write-handle to $filename fails (or if $filename is undef or zero-length), then a fatal error results.
$h = RTF::Writer->new_to_handle(*FILEHANDLE);
This creates a new RTF output stream object, such that sending text to this object will write to the filehandle given. The filehandle can be a glob (*FH) or a filehandle object (*FH{IO} or the value from IO::File->new(...)).
$h = RTF::Writer->new_to_string($string);
This creates a new RTF output stream object, such that sending text to this object will append to the string that youve passed a reference to.
$h->print(...);
This is the basic method for writing text to an RTF stream. This takes a list of items. Each item is either:
a plain string, like "foon"
In this case, the value is imputed to be a plaintext string, and an rtf-escaped version of it is written. For example "StuffnttUmmmn" causes Stuffline tab tab Ummline to be written. See rtfesc(x) for further details of escaping.
a scalar-reference, like ul
In this case, the value is imputed to be a reference to already escaped text. This is the basic way to emit RTF codes. Text passed this way will be written without any additional escaping.
Unless $RTF::Writer::AUTO_NL (normally on) has been turned off, the item written will be followed with a (presumably harmless) newline character to delimit any code in there from any following text, if the last character of this string is a digit or a lowercase letter. This is so that (i, "foo!") emits i[newline]foo! (which does what you expected), instead of ifoo!, which looks like an RTF command "ifoo" followed by a plaintext "!".
an array-reference, like [ ul, foo ]
This emits an open-brace "{", as RTF uses for opening "groups" (generally for delimiting the effects of character-formatting commands like ul, or a few formatting commands like footnote); then it emits the items in the referred-to array; and then emits a closing "}". I intend this to be useful is making sure that you dont emit more open-braces than close-braces, since that usually makes RTF readers immediately reject such a file.
You can nest these array-references, like:
$h->print(
col2,
[ pard,
"It is now ",
[ f1,
scalar(localtime), " local, or ",
scalar(gmtime), " GMT.",
],
" -- if youre ",
[ i,
"keeping track.",
],
],
parpage,
);
The return value of the print() method is currently always the value 1, although this may change.
$h->prolog(...);
This writes an RTF prolog to $h. You are free to make your own prolog using just $h->print(...your own code...), but I find in easier to automate this task, particularly with some sane defaults.
Since emitting a prolog opens a "{"-group, calling $h->prolog(...) sets a flag in $h so that when you call $h->close(), a closing "}" will automatically be written before the stream object is actually closed.
The options to the prolog() method are passed as a list of keys and values, for controlling the contents of the prolog written. The options are listed below, roughly with the most important options first.
(Be careful with the spelling of these options. Some are rather odd, because they are (mostly) based on the name of the relevent RTF command, and a systematic naming scheme for commands is one thing you wont find in RTF!)
fonts => [ "Courier New", "Georgia", "Whatever"...],
This value is for the font table section of the prolog. If the value is an arrayref, then it should be a reference to an array whose items should be either plain text strings, like "Times Roman", which are the (unescaped) names of fonts; or the items in the array can be scalar-refs, for expressing RTF control words along with the (escaped) font name, as in froman Times New Roman. If the value of the "fonts" parameters is a scalar ref, then it is taken to be a reference to code of your own that expresses the whole font table. If you dont specify a value for the "font" option, then you get a font table with one entry, "Times New Roman".
You should be sure to declare all fonts that you switch to in your document (as with f3, to change the current font to whats declared in entry 3 (counting from 0) in the font table).
deff => INTEGER,
This is for expressing, in the prolog, the font-table number of the default font for this document. The default is 0, which is an often useful value.
colors => [ undef, [0,142,252], [200,32,0], ...],
This value is for expressing the documents (generally optional) color table. If you stipulate an arrayref value, then each item of the array should be either an RGB triplet expressed as an arrayref like [200,32,0], or undef, for a null color-entry. If you stipulate a scalar-ref value for colors, then it is taken to be a reference to code of your own that expresses the whole font table.
If you dont stipulate any value for colors, then you get a table consisting of three colors: null/default (undef), 100% red ([2550,0,0]), and 100% blue ([0,0,255]).
You can freely ignore concerns of color tables if you dont use color-changing codes in your document (like cf2, to switch the text foreground color to whats declared at entry 2 (starting from 0) in the color table).
stylesheet => STRING,
filetbl => STRING,
listtables => STRING,
revtbl => STRING,
These are for expressing, in the prolog, code constituting the documents style sheet, table-of-files, table-of-lists, and table-of-revisions, respectively. The default value of each of these is empty-string. None of these are needed by a typical RTF document.
more_default => STRING,
This is for inserting any additional code just after the deffN in the start of the prolog, before the font table. A common useful value here is deflang1033, to express the default language (1033 = RTFese for US English) for the document, although my reading of the RTF spec leads me to believe that this doesnt need to be in the prolog here (where many writers put it, as apparently accepted by many RTF readers), but should (instead?) go just after the prolog, with other "document formatting" commands described in the "Document Formatting Properties" section of the RTF Specification.
doccomm => STRING,
This value is for the "document comment" metainformation item in the prolog, which appears as the "Comment" field in the "File Properties" panel in MSWord, or as the "Abstract" field in the "File Properties" window in WordPerfect.
If no value is specified, then RTF::Writer puts a string noting the value of $0 (typically the filespec to the current Perl program), and the version of RTF::Writer used.
title => STRING,
subject => STRING,
author => STRING,
manager => STRING,
company => STRING,
operator => STRING,
category => STRING,
keywords => STRING,
hlinkbase => STRING,
comment => STRING,
These are for stipulating the string values of these various optional document metainformation items. operator is for the name of the person who last made changes to the document; hlinkbase is which is the URL or path that is used for for resolving any all relative hyperlinks in the document; comment is reportedly just ignored (cf. the doccomm attribute, which is not ignored); and you can guess the rest.
The meanings of all of these are explained in greater detail in the RTF spec.
revtim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. EPOCH_NUMBER is the number of seconds since the epoch, such as one gets from (stat($thing)[9]) or time(); or you may pass a reference a timelist, like [localtime($whatever)].
If no defined value for revtime is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any creatim value.
creatim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. If no defined value for creatim is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any creatim value.
printim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the time when this document was last printed. If you dont stipulate a defined value here, no printim metainformation is written.
buptim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the "backup time" of this document. If you dont stipulate a defined value here, no buptim metainformation is written.
version => INTEGER,
vern => INTEGER,
edmins => INTEGER,
nofpages => INTEGER,
nofwords => INTEGER,
nofchars => INTEGER,
nofcharsws => INTEGER,
id => INTEGER,
These are for stipulating the integer values of these various optional (and not terribly useful, for most purposes!) document metainformation items. The meanings of all of these are explained in the RTF spec.
charset => STRING,
This is for expressing, in the prolog, RTF codename for the character set being used in this document. The default is "ansi", and dont stipulate anything else (like "mac", "pc", or "pca") unless you know what youre doing.
rtf_version => INTEGER,
This is for expressing, in the prolog, what major version of RTF is being used in this document. The default is 1, and dont use anything else unless you really know what youre doing.
$h->printf(format, ...items...);
This is just short for $h->print(sprintf(format, ...items...)
$h->printf(format, ...items...);
In this case, format is assumed to contain already-escaped RTF code. The items in ...items... are escaped as necessary, and then interpolated. I.e., this is rather like: $h->print(sprintf format, map rtfesc($_), ...items...)) except that numeric items dont get escaped (and dont need to be). Example:
$h->printf(
{i "%s"} was found in %2.2f percent of matchespar,
$word, 100 * $count / $total
);
$h->number_pages();
$h->number_pages(...);
This is just a handy wrapper for some code that turns on page numbering. If you call this method, you should call it right after you emit a prolog.
The page numbering consists of just putting the page number at the top-right of each page. If you provide items in the list (...), then that is pre-pended to the page number. Example:
$h->number_pages("Lexicon, p.");
Or:
$h->number_pages(bfs30f2, "page ");
$trdecl = RTF::Writer::TableRowDecl->new( ...options... )
This constructs an object representing a declaration for a table row. You can have to use it in calls to $h->row($tabldecl,...), and can reuse it on subsequent calls. This object is for declaring the dimensions of table rows.
The work that a declaration has to do, is best explained in this diagram of a bordered three-cell table (first cell containing "Foo ya!"), placed near a left margin (shown as the line of colons). The things in brackets are not on the page, but just for our reference:
: [..w1...]
: [......w2.......]
: [...w3....]
[.A..] [.B.] [.B.]
:
: +-------+---------------+---------+
: | Foo | Bar baz | Yee! |
: | ya! | quuxi quuxo | |
: | | quaqua. | |
: +-------+---------------+---------+
:
[.A..] [.B.] [.B.]
[..r1........]
[.....r2.....................]
[........r3............................]
Here the horizontal dimensions of the three-celled table are expressed in terms of: A, the distance from the current left margin; B, the minimum distance between the content of the cells (or you can think of this as twice the internal left or right borders in each cell); and then EITHER [w1, w2, w3], expressing the width of each cell, OR [r1, r2, r3], expressing each cells right ends distance from the current left margin. All distances are, of course, in twips.
Options to RTF::Writer::TableRowDecl->new( ...options... ) are:
left_start => TWIPS,
This declares the distance between the left margin, and the left end of the table. Default is 0.
inbetween => TWIPS,
This declares the distance labelled "B", above. Default is 120, which is 6 points, 1/12th-inch, about 2mm.
widths => [TWIPS, TWIPS, TWIPS, ... ],
This expresses the widths of each of the cells in this row, starting from the leftmost.
reaches => [TWIPS, TWIPS, TWIPS, ... ],
This expresses the rightmost extreme of each of the cells in this row.
align => alignmentspecs,
This is explained in detail in the section "Cell Alignment Syntax", below.
borders => borderspecs,
This is explained in detail in the section "Cell Border Syntax", below.
$h->paragraph(...);
This makes the items in the list (...) into a paragraph. Basically just a wrapper for $h->print([ {par, ..., pard}, ])
$h->row($trdecl, ...items...);
This emits a table row, with dimensions as stipulated by the $trdecl object, and with row content from the items given.
You must provide a value for $trdecl, or a fatal error results.
If you provide fewer items than $trdecl declares cells, then you get empty cells to fill out the row. If you provide more items than $trdecl declares cells, then the width of the last declared row is used in figuring the width of the additional cells for this row.
Example:
my $decl = RTF::Writer::TableRowDecl->new(widths => [1500,1900]);
$h->row($decl, "Stuff", "Hmmm");
$h->row($decl, [ul, Foo], Bar, bullet);
$h->row($decl, "Hooboy.");
This creates a table resembing:
+-------------+-------------------+
| Stuff | Hmm |
+-------------+-------------------+-------------------+
| _Foo_ | Bar | * |
+-------------+-------------------+-------------------+
| "Hooboy." | |
+-------------+-------------------+
Note that you MUST NOT use par commands in any items you emit in row cells!
The $h->row(...) method is a wrapper for producing elementary tables in RTF, with the minimum of parameters; the myriad other options that tables can have (for example, changing borders) are not supported. If you really need to generate tables fancier than what $h->row(...) can produce, start off reading the RTF spec, reading the source for row() (and the RTF::Writer::TableRowDecl class), and progress from there. Note that MSWord has been known to crash when given malformed RTF table code.
$h->table($trdecl, [...row1 items...], [...row2 items...], ... );
$h->table([...row1 items...], [...row2 items...], ... );
This is a wrapper around $h->row. It takes a list of arrayrefs, which are fed to calls to h->row($tr_decl, @$each_arrayref). You should provide a $trdecl, but if you dont, then one is crudely guessed at, based on the maximum number of columns in all rows.
$h->image( image_parameters )
This returns a scalar-reference to RTF-code representing the given image with given parameters. For example:
$h->paragraph(
"See here: ",
$h->image( filename => "foo.png", ),
);
The legal options are explained below:
filename => FILENAME,
This should be the path to a readable filename. You have to specify this. If you dont specify this, or if the value isnt a readable file, then a fatal error results. Currently, only JPEGs and PNGs are allowed; specifying any other kind of file causes a fatal error.
(The filename option above is required, but the following options are all generally optional -- altho some RTF processors may be finicky if you set some of the following but not others, for no apparent reason. When in doubt, test.)
wgoal => TWIPS,
The desired width of the image
hgoal => TWIPS,
The desired height of the image
scalex => PERCENT,
scaley => PERCENT,
Respectively, the horizontal (X) or vertical (Y) scaling value. The argument is an integer representing a percentage. (The default is 100 percent)
cropt => TWIPS,
cropb => TWIPS,
cropl => TWIPS,
cropr => TWIPS,
These specify the top, bottom, left, and right cropping values. A positive value crops toward the center of the image. A negative value crops away from the center, adding a padding space around the image.
(The default is to do neither, as youd get from a cropping value of 0.)
picspecs => SCALARVALUE,
This overrides generation of the normal image values based the image and the above parameters, and instead uses whatever value you pass a reference to. You normally shouldnt need to use this.
$h->image_paragraph( image_parameters );
This take the same options as $h->image(...), but has three differences: First, it is a shortcut for this:
$h->paragraph( qc,
$h->image( ...params...),
);
Secondly, whereas $h->image(...) returns the image data (as an RTF scalarref), $h->image_paragraph(...) doesnt return much of anything.
Thirdly, $h->image_paragraph(...) is often much more memory-efficient, since it can write the image data to a file as its RTF-ified, instead of building it all up in memory.
$h->close();
This completes writing to the stream denoted by the object in $h; this generally (assuming youd called $h->prolog) involves just writing a final close-brace to $h, and then closing whatever filehandle or file $h writes to (unless were writing to a string, in which case we just discard $hs reference to it). After you call $h->close, you should not call any other methods with $h!
Note that you dont have to explicitly call $h->close -- when an unclosed RTF::Writer object goes out of scope (or, more precisely speaking, when if its refcount hits zero), then something equivalent to calling $h->close is done automatically for you.
<<lessSYNOPSIS
use RTF::Writer;
my $rtf = RTF::Writer->new_to_file("greetings.rtf");
$rtf->prolog( title => "Greetings, hyoomon" );
$rtf->number_pages;
$rtf->paragraph(
fs40bi, # 20pt, bold, italic
"Hi there!"
);
$rtf->close;
This module is a class; an object belonging to this class acts like an output filehandle, and calling methods on it causes RTF text to be written.
Incidentally, this module also exports a few useful functions, upon request.
METHODS
$h = RTF::Writer->new_to_file($filename);
This creates a new RTF output stream object, such that sending text to this object will write to the filespec given. This is basically a wrapper around new_to_handle. If opening a write-handle to $filename fails (or if $filename is undef or zero-length), then a fatal error results.
$h = RTF::Writer->new_to_handle(*FILEHANDLE);
This creates a new RTF output stream object, such that sending text to this object will write to the filehandle given. The filehandle can be a glob (*FH) or a filehandle object (*FH{IO} or the value from IO::File->new(...)).
$h = RTF::Writer->new_to_string($string);
This creates a new RTF output stream object, such that sending text to this object will append to the string that youve passed a reference to.
$h->print(...);
This is the basic method for writing text to an RTF stream. This takes a list of items. Each item is either:
a plain string, like "foon"
In this case, the value is imputed to be a plaintext string, and an rtf-escaped version of it is written. For example "StuffnttUmmmn" causes Stuffline tab tab Ummline to be written. See rtfesc(x) for further details of escaping.
a scalar-reference, like ul
In this case, the value is imputed to be a reference to already escaped text. This is the basic way to emit RTF codes. Text passed this way will be written without any additional escaping.
Unless $RTF::Writer::AUTO_NL (normally on) has been turned off, the item written will be followed with a (presumably harmless) newline character to delimit any code in there from any following text, if the last character of this string is a digit or a lowercase letter. This is so that (i, "foo!") emits i[newline]foo! (which does what you expected), instead of ifoo!, which looks like an RTF command "ifoo" followed by a plaintext "!".
an array-reference, like [ ul, foo ]
This emits an open-brace "{", as RTF uses for opening "groups" (generally for delimiting the effects of character-formatting commands like ul, or a few formatting commands like footnote); then it emits the items in the referred-to array; and then emits a closing "}". I intend this to be useful is making sure that you dont emit more open-braces than close-braces, since that usually makes RTF readers immediately reject such a file.
You can nest these array-references, like:
$h->print(
col2,
[ pard,
"It is now ",
[ f1,
scalar(localtime), " local, or ",
scalar(gmtime), " GMT.",
],
" -- if youre ",
[ i,
"keeping track.",
],
],
parpage,
);
The return value of the print() method is currently always the value 1, although this may change.
$h->prolog(...);
This writes an RTF prolog to $h. You are free to make your own prolog using just $h->print(...your own code...), but I find in easier to automate this task, particularly with some sane defaults.
Since emitting a prolog opens a "{"-group, calling $h->prolog(...) sets a flag in $h so that when you call $h->close(), a closing "}" will automatically be written before the stream object is actually closed.
The options to the prolog() method are passed as a list of keys and values, for controlling the contents of the prolog written. The options are listed below, roughly with the most important options first.
(Be careful with the spelling of these options. Some are rather odd, because they are (mostly) based on the name of the relevent RTF command, and a systematic naming scheme for commands is one thing you wont find in RTF!)
fonts => [ "Courier New", "Georgia", "Whatever"...],
This value is for the font table section of the prolog. If the value is an arrayref, then it should be a reference to an array whose items should be either plain text strings, like "Times Roman", which are the (unescaped) names of fonts; or the items in the array can be scalar-refs, for expressing RTF control words along with the (escaped) font name, as in froman Times New Roman. If the value of the "fonts" parameters is a scalar ref, then it is taken to be a reference to code of your own that expresses the whole font table. If you dont specify a value for the "font" option, then you get a font table with one entry, "Times New Roman".
You should be sure to declare all fonts that you switch to in your document (as with f3, to change the current font to whats declared in entry 3 (counting from 0) in the font table).
deff => INTEGER,
This is for expressing, in the prolog, the font-table number of the default font for this document. The default is 0, which is an often useful value.
colors => [ undef, [0,142,252], [200,32,0], ...],
This value is for expressing the documents (generally optional) color table. If you stipulate an arrayref value, then each item of the array should be either an RGB triplet expressed as an arrayref like [200,32,0], or undef, for a null color-entry. If you stipulate a scalar-ref value for colors, then it is taken to be a reference to code of your own that expresses the whole font table.
If you dont stipulate any value for colors, then you get a table consisting of three colors: null/default (undef), 100% red ([2550,0,0]), and 100% blue ([0,0,255]).
You can freely ignore concerns of color tables if you dont use color-changing codes in your document (like cf2, to switch the text foreground color to whats declared at entry 2 (starting from 0) in the color table).
stylesheet => STRING,
filetbl => STRING,
listtables => STRING,
revtbl => STRING,
These are for expressing, in the prolog, code constituting the documents style sheet, table-of-files, table-of-lists, and table-of-revisions, respectively. The default value of each of these is empty-string. None of these are needed by a typical RTF document.
more_default => STRING,
This is for inserting any additional code just after the deffN in the start of the prolog, before the font table. A common useful value here is deflang1033, to express the default language (1033 = RTFese for US English) for the document, although my reading of the RTF spec leads me to believe that this doesnt need to be in the prolog here (where many writers put it, as apparently accepted by many RTF readers), but should (instead?) go just after the prolog, with other "document formatting" commands described in the "Document Formatting Properties" section of the RTF Specification.
doccomm => STRING,
This value is for the "document comment" metainformation item in the prolog, which appears as the "Comment" field in the "File Properties" panel in MSWord, or as the "Abstract" field in the "File Properties" window in WordPerfect.
If no value is specified, then RTF::Writer puts a string noting the value of $0 (typically the filespec to the current Perl program), and the version of RTF::Writer used.
title => STRING,
subject => STRING,
author => STRING,
manager => STRING,
company => STRING,
operator => STRING,
category => STRING,
keywords => STRING,
hlinkbase => STRING,
comment => STRING,
These are for stipulating the string values of these various optional document metainformation items. operator is for the name of the person who last made changes to the document; hlinkbase is which is the URL or path that is used for for resolving any all relative hyperlinks in the document; comment is reportedly just ignored (cf. the doccomm attribute, which is not ignored); and you can guess the rest.
The meanings of all of these are explained in greater detail in the RTF spec.
revtim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. EPOCH_NUMBER is the number of seconds since the epoch, such as one gets from (stat($thing)[9]) or time(); or you may pass a reference a timelist, like [localtime($whatever)].
If no defined value for revtime is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any creatim value.
creatim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the last-modified time of the document. If no defined value for creatim is stipulated in the call to prolog(...) then the current value of time() is used. Explicitly pass a value of undef to suppress emitting any creatim value.
printim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the time when this document was last printed. If you dont stipulate a defined value here, no printim metainformation is written.
buptim => EPOCH_NUMBER,
This value is for the document metainformation section of the prolog. It signifies the "backup time" of this document. If you dont stipulate a defined value here, no buptim metainformation is written.
version => INTEGER,
vern => INTEGER,
edmins => INTEGER,
nofpages => INTEGER,
nofwords => INTEGER,
nofchars => INTEGER,
nofcharsws => INTEGER,
id => INTEGER,
These are for stipulating the integer values of these various optional (and not terribly useful, for most purposes!) document metainformation items. The meanings of all of these are explained in the RTF spec.
charset => STRING,
This is for expressing, in the prolog, RTF codename for the character set being used in this document. The default is "ansi", and dont stipulate anything else (like "mac", "pc", or "pca") unless you know what youre doing.
rtf_version => INTEGER,
This is for expressing, in the prolog, what major version of RTF is being used in this document. The default is 1, and dont use anything else unless you really know what youre doing.
$h->printf(format, ...items...);
This is just short for $h->print(sprintf(format, ...items...)
$h->printf(format, ...items...);
In this case, format is assumed to contain already-escaped RTF code. The items in ...items... are escaped as necessary, and then interpolated. I.e., this is rather like: $h->print(sprintf format, map rtfesc($_), ...items...)) except that numeric items dont get escaped (and dont need to be). Example:
$h->printf(
{i "%s"} was found in %2.2f percent of matchespar,
$word, 100 * $count / $total
);
$h->number_pages();
$h->number_pages(...);
This is just a handy wrapper for some code that turns on page numbering. If you call this method, you should call it right after you emit a prolog.
The page numbering consists of just putting the page number at the top-right of each page. If you provide items in the list (...), then that is pre-pended to the page number. Example:
$h->number_pages("Lexicon, p.");
Or:
$h->number_pages(bfs30f2, "page ");
$trdecl = RTF::Writer::TableRowDecl->new( ...options... )
This constructs an object representing a declaration for a table row. You can have to use it in calls to $h->row($tabldecl,...), and can reuse it on subsequent calls. This object is for declaring the dimensions of table rows.
The work that a declaration has to do, is best explained in this diagram of a bordered three-cell table (first cell containing "Foo ya!"), placed near a left margin (shown as the line of colons). The things in brackets are not on the page, but just for our reference:
: [..w1...]
: [......w2.......]
: [...w3....]
[.A..] [.B.] [.B.]
:
: +-------+---------------+---------+
: | Foo | Bar baz | Yee! |
: | ya! | quuxi quuxo | |
: | | quaqua. | |
: +-------+---------------+---------+
:
[.A..] [.B.] [.B.]
[..r1........]
[.....r2.....................]
[........r3............................]
Here the horizontal dimensions of the three-celled table are expressed in terms of: A, the distance from the current left margin; B, the minimum distance between the content of the cells (or you can think of this as twice the internal left or right borders in each cell); and then EITHER [w1, w2, w3], expressing the width of each cell, OR [r1, r2, r3], expressing each cells right ends distance from the current left margin. All distances are, of course, in twips.
Options to RTF::Writer::TableRowDecl->new( ...options... ) are:
left_start => TWIPS,
This declares the distance between the left margin, and the left end of the table. Default is 0.
inbetween => TWIPS,
This declares the distance labelled "B", above. Default is 120, which is 6 points, 1/12th-inch, about 2mm.
widths => [TWIPS, TWIPS, TWIPS, ... ],
This expresses the widths of each of the cells in this row, starting from the leftmost.
reaches => [TWIPS, TWIPS, TWIPS, ... ],
This expresses the rightmost extreme of each of the cells in this row.
align => alignmentspecs,
This is explained in detail in the section "Cell Alignment Syntax", below.
borders => borderspecs,
This is explained in detail in the section "Cell Border Syntax", below.
$h->paragraph(...);
This makes the items in the list (...) into a paragraph. Basically just a wrapper for $h->print([ {par, ..., pard}, ])
$h->row($trdecl, ...items...);
This emits a table row, with dimensions as stipulated by the $trdecl object, and with row content from the items given.
You must provide a value for $trdecl, or a fatal error results.
If you provide fewer items than $trdecl declares cells, then you get empty cells to fill out the row. If you provide more items than $trdecl declares cells, then the width of the last declared row is used in figuring the width of the additional cells for this row.
Example:
my $decl = RTF::Writer::TableRowDecl->new(widths => [1500,1900]);
$h->row($decl, "Stuff", "Hmmm");
$h->row($decl, [ul, Foo], Bar, bullet);
$h->row($decl, "Hooboy.");
This creates a table resembing:
+-------------+-------------------+
| Stuff | Hmm |
+-------------+-------------------+-------------------+
| _Foo_ | Bar | * |
+-------------+-------------------+-------------------+
| "Hooboy." | |
+-------------+-------------------+
Note that you MUST NOT use par commands in any items you emit in row cells!
The $h->row(...) method is a wrapper for producing elementary tables in RTF, with the minimum of parameters; the myriad other options that tables can have (for example, changing borders) are not supported. If you really need to generate tables fancier than what $h->row(...) can produce, start off reading the RTF spec, reading the source for row() (and the RTF::Writer::TableRowDecl class), and progress from there. Note that MSWord has been known to crash when given malformed RTF table code.
$h->table($trdecl, [...row1 items...], [...row2 items...], ... );
$h->table([...row1 items...], [...row2 items...], ... );
This is a wrapper around $h->row. It takes a list of arrayrefs, which are fed to calls to h->row($tr_decl, @$each_arrayref). You should provide a $trdecl, but if you dont, then one is crudely guessed at, based on the maximum number of columns in all rows.
$h->image( image_parameters )
This returns a scalar-reference to RTF-code representing the given image with given parameters. For example:
$h->paragraph(
"See here: ",
$h->image( filename => "foo.png", ),
);
The legal options are explained below:
filename => FILENAME,
This should be the path to a readable filename. You have to specify this. If you dont specify this, or if the value isnt a readable file, then a fatal error results. Currently, only JPEGs and PNGs are allowed; specifying any other kind of file causes a fatal error.
(The filename option above is required, but the following options are all generally optional -- altho some RTF processors may be finicky if you set some of the following but not others, for no apparent reason. When in doubt, test.)
wgoal => TWIPS,
The desired width of the image
hgoal => TWIPS,
The desired height of the image
scalex => PERCENT,
scaley => PERCENT,
Respectively, the horizontal (X) or vertical (Y) scaling value. The argument is an integer representing a percentage. (The default is 100 percent)
cropt => TWIPS,
cropb => TWIPS,
cropl => TWIPS,
cropr => TWIPS,
These specify the top, bottom, left, and right cropping values. A positive value crops toward the center of the image. A negative value crops away from the center, adding a padding space around the image.
(The default is to do neither, as youd get from a cropping value of 0.)
picspecs => SCALARVALUE,
This overrides generation of the normal image values based the image and the above parameters, and instead uses whatever value you pass a reference to. You normally shouldnt need to use this.
$h->image_paragraph( image_parameters );
This take the same options as $h->image(...), but has three differences: First, it is a shortcut for this:
$h->paragraph( qc,
$h->image( ...params...),
);
Secondly, whereas $h->image(...) returns the image data (as an RTF scalarref), $h->image_paragraph(...) doesnt return much of anything.
Thirdly, $h->image_paragraph(...) is often much more memory-efficient, since it can write the image data to a file as its RTF-ified, instead of building it all up in memory.
$h->close();
This completes writing to the stream denoted by the object in $h; this generally (assuming youd called $h->prolog) involves just writing a final close-brace to $h, and then closing whatever filehandle or file $h writes to (unless were writing to a string, in which case we just discard $hs reference to it). After you call $h->close, you should not call any other methods with $h!
Note that you dont have to explicitly call $h->close -- when an unclosed RTF::Writer object goes out of scope (or, more precisely speaking, when if its refcount hits zero), then something equivalent to calling $h->close is done automatically for you.
Download (0.056MB)
Added: 2007-07-17 License: Perl Artistic License Price:
515 downloads
B::Deparse 5.8.8
B::Deparse is a Perl compiler backend to produce perl code. more>>
B::Deparse is a Perl compiler backend to produce perl code.
SYNOPSIS
perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sLETTERS][,-xLEVEL] prog.pl
B::Deparse is a backend module for the Perl compiler that generates perl source code, based on the internal compiled structure that perl itself creates after parsing a program. The output of B::Deparse wont be exactly the same as the original source, since perl doesnt keep track of comments or whitespace, and there isnt a one-to-one correspondence between perls syntactical constructions and their compiled form, but it will often be close. When you use the -p option, the output also includes parentheses even when they are not required by precedence, which can make it easy to see if perl is parsing your expressions the way you intended.
While B::Deparse goes to some lengths to try to figure out what your original program was doing, some parts of the language can still trip it up; it still fails even on some parts of Perls own test suite. If you encounter a failure other than the most common ones described in the BUGS section below, you can help contribute to B::Deparses ongoing development by submitting a bug report with a small example.
OPTIONS
As with all compiler backend options, these must follow directly after the -MO=Deparse, separated by a comma but not any white space.
-d
Output data values (when they appear as constants) using Data::Dumper. Without this option, B::Deparse will use some simple routines of its own for the same purpose. Currently, Data::Dumper is better for some kinds of data (such as complex structures with sharing and self-reference) while the built-in routines are better for others (such as odd floating-point values).
-fFILE
Normally, B::Deparse deparses the main code of a program, and all the subs defined in the same file. To include subs defined in other files, pass the -f option with the filename. You can pass the -f option several times, to include more than one secondary file. (Most of the time you dont want to use it at all.) You can also use this option to include subs which are defined in the scope of a #line directive with two parameters.
-l
Add #line declarations to the output based on the line and file locations of the original code.
-p
Print extra parentheses. Without this option, B::Deparse includes parentheses in its output only when they are needed, based on the structure of your program. With -p, it uses parentheses (almost) whenever they would be legal. This can be useful if you are used to LISP, or if you want to see how perl parses your input. If you say
if ($var & 0x7f == 65) {print "Gimme an A!"}
print ($which ? $a : $b), "n";
$name = $ENV{USER} or "Bob";
B::Deparse,-p will print
if (($var & 0)) {
print(Gimme an A!)
};
(print(($which ? $a : $b)), ???);
(($name = $ENV{USER}) or ???)
which probably isnt what you intended (the ??? is a sign that perl optimized away a constant value).
-P
Disable prototype checking. With this option, all function calls are deparsed as if no prototype was defined for them. In other words,
perl -MO=Deparse,-P -e sub foo (@) { 1 } foo @x
will print
sub foo (@) {
1;
}
&foo(@x);
making clear how the parameters are actually passed to foo.
-q
Expand double-quoted strings into the corresponding combinations of concatenation, uc, ucfirst, lc, lcfirst, quotemeta, and join. For instance, print
print "Hello, $world, @ladies, u$gentlemenE, uL$me!";
as
print Hello, . $world . , . join($", @ladies) . ,
. ucfirst($gentlemen) . , . ucfirst(lc $me . !);
Note that the expanded form represents the way perl handles such constructions internally -- this option actually turns off the reverse translation that B::Deparse usually does. On the other hand, note that $x = "$y" is not the same as $x = $y: the former makes the value of $y into a string before doing the assignment.
-sLETTERS
Tweak the style of B::Deparses output. The letters should follow directly after the s, with no space or punctuation. The following options are available:
C
Cuddle elsif, else, and continue blocks. For example, print
if (...) {
...
} else {
...
}
instead of
if (...) {
...
}
else {
...
}
The default is not to cuddle.
iNUMBER
Indent lines by multiples of NUMBER columns. The default is 4 columns.
T
Use tabs for each 8 columns of indent. The default is to use only spaces. For instance, if the style options are -si4T, a line thats indented 3 times will be preceded by one tab and four spaces; if the options were -si8T, the same line would be preceded by three tabs.
vSTRING.
Print STRING for the value of a constant that cant be determined because it was optimized away (mnemonic: this happens when a constant is used in void context). The end of the string is marked by a period. The string should be a valid perl expression, generally a constant. Note that unless its a number, it probably needs to be quoted, and on a command line quotes need to be protected from the shell. Some conventional values include 0, 1, 42, , foo, and Useless use of constant omitted (which may need to be -sv"Useless use of constant omitted." or something similar depending on your shell). The default is ???. If youre using B::Deparse on a module or other file thats required, you shouldnt use a value that evaluates to false, since the customary true constant at the end of a module will be in void context when the file is compiled as a main program.
-xLEVEL
Expand conventional syntax constructions into equivalent ones that expose their internal operation. LEVEL should be a digit, with higher values meaning more expansion. As with -q, this actually involves turning off special cases in B::Deparses normal operations.
If LEVEL is at least 3, for loops will be translated into equivalent while loops with continue blocks; for instance
for ($i = 0; $i < 10; ++$i) {
print $i;
}
turns into
$i = 0;
while ($i < 10) {
print $i;
} continue {
++$i
}
Note that in a few cases this translation cant be perfectly carried back into the source code -- if the loops initializer declares a my variable, for instance, it wont have the correct scope outside of the loop.
If LEVEL is at least 5, use declarations will be translated into BEGIN blocks containing calls to require and import; for instance,
use strict refs;
turns into
sub BEGIN {
require strict;
do {
strict->import(refs)
};
}
If LEVEL is at least 7, if statements will be translated into equivalent expressions using &&, ?: and do {}; for instance
print hi if $nice;
if ($nice) {
print hi;
}
if ($nice) {
print hi;
} else {
print bye;
}
turns into
$nice and print hi;
$nice and do { print hi };
$nice ? do { print hi } : do { print bye };
Long sequences of elsifs will turn into nested ternary operators, which B::Deparse doesnt know how to indent nicely.
<<lessSYNOPSIS
perl -MO=Deparse[,-d][,-fFILE][,-p][,-q][,-l] [,-sLETTERS][,-xLEVEL] prog.pl
B::Deparse is a backend module for the Perl compiler that generates perl source code, based on the internal compiled structure that perl itself creates after parsing a program. The output of B::Deparse wont be exactly the same as the original source, since perl doesnt keep track of comments or whitespace, and there isnt a one-to-one correspondence between perls syntactical constructions and their compiled form, but it will often be close. When you use the -p option, the output also includes parentheses even when they are not required by precedence, which can make it easy to see if perl is parsing your expressions the way you intended.
While B::Deparse goes to some lengths to try to figure out what your original program was doing, some parts of the language can still trip it up; it still fails even on some parts of Perls own test suite. If you encounter a failure other than the most common ones described in the BUGS section below, you can help contribute to B::Deparses ongoing development by submitting a bug report with a small example.
OPTIONS
As with all compiler backend options, these must follow directly after the -MO=Deparse, separated by a comma but not any white space.
-d
Output data values (when they appear as constants) using Data::Dumper. Without this option, B::Deparse will use some simple routines of its own for the same purpose. Currently, Data::Dumper is better for some kinds of data (such as complex structures with sharing and self-reference) while the built-in routines are better for others (such as odd floating-point values).
-fFILE
Normally, B::Deparse deparses the main code of a program, and all the subs defined in the same file. To include subs defined in other files, pass the -f option with the filename. You can pass the -f option several times, to include more than one secondary file. (Most of the time you dont want to use it at all.) You can also use this option to include subs which are defined in the scope of a #line directive with two parameters.
-l
Add #line declarations to the output based on the line and file locations of the original code.
-p
Print extra parentheses. Without this option, B::Deparse includes parentheses in its output only when they are needed, based on the structure of your program. With -p, it uses parentheses (almost) whenever they would be legal. This can be useful if you are used to LISP, or if you want to see how perl parses your input. If you say
if ($var & 0x7f == 65) {print "Gimme an A!"}
print ($which ? $a : $b), "n";
$name = $ENV{USER} or "Bob";
B::Deparse,-p will print
if (($var & 0)) {
print(Gimme an A!)
};
(print(($which ? $a : $b)), ???);
(($name = $ENV{USER}) or ???)
which probably isnt what you intended (the ??? is a sign that perl optimized away a constant value).
-P
Disable prototype checking. With this option, all function calls are deparsed as if no prototype was defined for them. In other words,
perl -MO=Deparse,-P -e sub foo (@) { 1 } foo @x
will print
sub foo (@) {
1;
}
&foo(@x);
making clear how the parameters are actually passed to foo.
-q
Expand double-quoted strings into the corresponding combinations of concatenation, uc, ucfirst, lc, lcfirst, quotemeta, and join. For instance, print
print "Hello, $world, @ladies, u$gentlemenE, uL$me!";
as
print Hello, . $world . , . join($", @ladies) . ,
. ucfirst($gentlemen) . , . ucfirst(lc $me . !);
Note that the expanded form represents the way perl handles such constructions internally -- this option actually turns off the reverse translation that B::Deparse usually does. On the other hand, note that $x = "$y" is not the same as $x = $y: the former makes the value of $y into a string before doing the assignment.
-sLETTERS
Tweak the style of B::Deparses output. The letters should follow directly after the s, with no space or punctuation. The following options are available:
C
Cuddle elsif, else, and continue blocks. For example, print
if (...) {
...
} else {
...
}
instead of
if (...) {
...
}
else {
...
}
The default is not to cuddle.
iNUMBER
Indent lines by multiples of NUMBER columns. The default is 4 columns.
T
Use tabs for each 8 columns of indent. The default is to use only spaces. For instance, if the style options are -si4T, a line thats indented 3 times will be preceded by one tab and four spaces; if the options were -si8T, the same line would be preceded by three tabs.
vSTRING.
Print STRING for the value of a constant that cant be determined because it was optimized away (mnemonic: this happens when a constant is used in void context). The end of the string is marked by a period. The string should be a valid perl expression, generally a constant. Note that unless its a number, it probably needs to be quoted, and on a command line quotes need to be protected from the shell. Some conventional values include 0, 1, 42, , foo, and Useless use of constant omitted (which may need to be -sv"Useless use of constant omitted." or something similar depending on your shell). The default is ???. If youre using B::Deparse on a module or other file thats required, you shouldnt use a value that evaluates to false, since the customary true constant at the end of a module will be in void context when the file is compiled as a main program.
-xLEVEL
Expand conventional syntax constructions into equivalent ones that expose their internal operation. LEVEL should be a digit, with higher values meaning more expansion. As with -q, this actually involves turning off special cases in B::Deparses normal operations.
If LEVEL is at least 3, for loops will be translated into equivalent while loops with continue blocks; for instance
for ($i = 0; $i < 10; ++$i) {
print $i;
}
turns into
$i = 0;
while ($i < 10) {
print $i;
} continue {
++$i
}
Note that in a few cases this translation cant be perfectly carried back into the source code -- if the loops initializer declares a my variable, for instance, it wont have the correct scope outside of the loop.
If LEVEL is at least 5, use declarations will be translated into BEGIN blocks containing calls to require and import; for instance,
use strict refs;
turns into
sub BEGIN {
require strict;
do {
strict->import(refs)
};
}
If LEVEL is at least 7, if statements will be translated into equivalent expressions using &&, ?: and do {}; for instance
print hi if $nice;
if ($nice) {
print hi;
}
if ($nice) {
print hi;
} else {
print bye;
}
turns into
$nice and print hi;
$nice and do { print hi };
$nice ? do { print hi } : do { print bye };
Long sequences of elsifs will turn into nested ternary operators, which B::Deparse doesnt know how to indent nicely.
Download (12.2MB)
Added: 2007-06-25 License: Perl Artistic License Price:
852 downloads
Secleted [ 0 ] software to compare
- Page: 1 of 1
- 1
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above ul 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