borang spa 8
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1149
Baghira 0.8
Baghira is a native style for QT/KDE. more>>
Baghira is a native style for QT/KDE.
The name refers to the Panther of Kiplings famous Jungle Book (German spelling)
You will probably rather know the Disney version...
Basically its a perky imitation of Apples OSX look.
Installation:
tar -xjf baghira.tar.bz2
cd baghira/baghira
./configure --prefix=`kde-config --prefix` --disable-debug [--enable-final]
(!!!BEGINNERS: the direction of the accents is _important_ (top-left to bottom-right), the rectangular brackets mean [this is optional] - dont type them!!!)
make
and finally as root:
make install
<<lessThe name refers to the Panther of Kiplings famous Jungle Book (German spelling)
You will probably rather know the Disney version...
Basically its a perky imitation of Apples OSX look.
Installation:
tar -xjf baghira.tar.bz2
cd baghira/baghira
./configure --prefix=`kde-config --prefix` --disable-debug [--enable-final]
(!!!BEGINNERS: the direction of the accents is _important_ (top-left to bottom-right), the rectangular brackets mean [this is optional] - dont type them!!!)
make
and finally as root:
make install
Download (0.89MB)
Added: 2007-04-16 License: GPL (GNU General Public License) Price:
925 downloads
B::Asmdata 5.8.8
B::Asmdata is an autogenerated data about Perl ops, used to generate bytecode. more>>
B::Asmdata is an autogenerated data about Perl ops, used to generate bytecode.
SYNOPSIS
use B::Asmdata qw(%insn_data @insn_name @optype @specialsv_name);
Provides information about Perl ops in order to generate bytecode via a bunch of exported variables. Its mostly used by B::Assembler and B::Disassembler.
%insn_data
my($bytecode_num, $put_sub, $get_meth) = @$insn_data{$op_name};
For a given $op_name (for example, cop_label, sv_flags, etc...) you get an array ref containing the bytecode number of the op, a reference to the subroutine used to PUT, and the name of the method used to GET.
@insn_name
my $op_name = $insn_name[$bytecode_num];
A simple mapping of the bytecode number to the name of the op. Suitable for using with %insn_data like so:
my $op_info = $insn_data{$insn_name[$bytecode_num]};
@optype
my $op_type = $optype[$op_type_num];
A simple mapping of the op type number to its type (like COP or BINOP).
@specialsv_name
my $sv_name = $specialsv_name[$sv_index];
Certain SV types are considered special. Theyre represented by B::SPECIAL and are referred to by a number from the specialsv_list. This array maps that number back to the name of the SV (like Nullsv or &PL_sv_undef).
<<lessSYNOPSIS
use B::Asmdata qw(%insn_data @insn_name @optype @specialsv_name);
Provides information about Perl ops in order to generate bytecode via a bunch of exported variables. Its mostly used by B::Assembler and B::Disassembler.
%insn_data
my($bytecode_num, $put_sub, $get_meth) = @$insn_data{$op_name};
For a given $op_name (for example, cop_label, sv_flags, etc...) you get an array ref containing the bytecode number of the op, a reference to the subroutine used to PUT, and the name of the method used to GET.
@insn_name
my $op_name = $insn_name[$bytecode_num];
A simple mapping of the bytecode number to the name of the op. Suitable for using with %insn_data like so:
my $op_info = $insn_data{$insn_name[$bytecode_num]};
@optype
my $op_type = $optype[$op_type_num];
A simple mapping of the op type number to its type (like COP or BINOP).
@specialsv_name
my $sv_name = $specialsv_name[$sv_index];
Certain SV types are considered special. Theyre represented by B::SPECIAL and are referred to by a number from the specialsv_list. This array maps that number back to the name of the SV (like Nullsv or &PL_sv_undef).
Download (12.2MB)
Added: 2007-06-26 License: Perl Artistic License Price:
850 downloads
GNU Parted 1.8.8
GNU Parted is a partition editor, for creating, destroying, resizing and copying partitions. more>>
GNU Parted is a program for creating, resizing, destroying, checking and copying partitions, and the file systems on them. This is useful for creating space for new operating systems, reorganising disk usage, copying data between hard disks and disk imaging.
Supported disk labels: raw access (useful for RAID and LVM), MS-DOS partition tables, Intel GPT partition tables, MIPS partition tables, PC98 partition tables, Sun and BSD disk labels and Macintosh partition maps.
Notes:
- For ext2, ext3 and reiserfs: the start of the partition must stay fixed.
- For ext2, ext3: the partition you copy to must be bigger or exactly the same size as the partition you copy from.
- For ext2 and ext3: the checking is limited to ensuring the resize and copy commands will be ok.
- For fat: the size of the new partition after resizing or copying is restricted by the cluster size. Parted can shrink the cluster size, so you can always shrink your partition. However, if you cant use FAT32 for some reason, you may not be able to grow your partition.
- Parted supports both FAT16 and FAT32. Parted can convert file systems between FAT16 and FAT32, if necessary.
- Reiserfs support is enabled if you install libreiserfs.
<<lessSupported disk labels: raw access (useful for RAID and LVM), MS-DOS partition tables, Intel GPT partition tables, MIPS partition tables, PC98 partition tables, Sun and BSD disk labels and Macintosh partition maps.
Notes:
- For ext2, ext3 and reiserfs: the start of the partition must stay fixed.
- For ext2, ext3: the partition you copy to must be bigger or exactly the same size as the partition you copy from.
- For ext2 and ext3: the checking is limited to ensuring the resize and copy commands will be ok.
- For fat: the size of the new partition after resizing or copying is restricted by the cluster size. Parted can shrink the cluster size, so you can always shrink your partition. However, if you cant use FAT32 for some reason, you may not be able to grow your partition.
- Parted supports both FAT16 and FAT32. Parted can convert file systems between FAT16 and FAT32, if necessary.
- Reiserfs support is enabled if you install libreiserfs.
Download (1.3MB)
Added: 2007-08-10 License: GPL (GNU General Public License) Price:
510 downloads
B::Concise 5.8.8
B::Concise is a Perl syntax tree, printing concise info about ops. more>>
B::Concise is a Perl syntax tree, printing concise info about ops.
SYNOPSIS
perl -MO=Concise[,OPTIONS] foo.pl
use B::Concise qw(set_style add_callback);
This compiler backend prints the internal OPs of a Perl programs syntax tree in one of several space-efficient text formats suitable for debugging the inner workings of perl or other compiler backends. It can print OPs in the order they appear in the OP tree, in the order they will execute, or in a text approximation to their tree structure, and the format of the information displayed is customizable. Its function is similar to that of perls -Dx debugging flag or the B::Terse module, but it is more sophisticated and flexible.
EXAMPLE
Heres an example of 2 outputs (aka renderings), using the -exec and -basic (i.e. default) formatting conventions on the same code snippet.
% perl -MO=Concise,-exec -e $a = $b + 42
1 enter
2 nextstate(main 1 -e:1) v
3 gvsv[*b] s
4 const[IV 42] s
* 5 add[t3] sK/2
6 gvsv[*a] s
7 sassign vKS/2
8 leave[1 ref] vKP/REFC
Each line corresponds to an opcode. The opcode marked with * is used in a few examples below.
The 1st column is the ops sequence number, starting at 1, and is displayed in base 36 by default. This rendering is in -exec (i.e. execution) order.
The symbol between angle brackets indicates the ops type, for example; < 2 > is a BINOP, < @ > a LISTOP, and < # > is a PADOP, which is used in threaded perls. (see "OP class abbreviations").
The opname, as in add[t1], which may be followed by op-specific information in parentheses or brackets (ex [t1]).
The op-flags (ex sK/2) follow, and are described in ("OP flags abbreviations").
% perl -MO=Concise -e $a = $b + 42
8 leave[1 ref] vKP/REFC ->(end)
1 enter ->2
2 nextstate(main 1 -e:1) v ->3
7 sassign vKS/2 ->8
* 5 add[t1] sK/2 ->6
- ex-rv2sv sK/1 ->4
3 gvsv(*b) s ->4
4 const(IV 42) s ->5
- ex-rv2sv sKRM*/1 ->7
6 gvsv(*a) s ->7
The default rendering is top-down, so theyre not in execution order. This form reflects the way the stack is used to parse and evaluate expressions; the add operates on the two terms below it in the tree.
Nullops appear as ex-opname, where opname is an op that has been optimized away by perl. Theyre displayed with a sequence-number of -, because they are not executed (they dont appear in previous example), theyre printed here because they reflect the parse.
The arrow points to the sequence number of the next op; theyre not displayed in -exec mode, for obvious reasons.
Note that because this rendering was done on a non-threaded perl, the PADOPs in the previous examples are now SVOPs, and some (but not all) of the square brackets have been replaced by round ones. This is a subtle feature to provide some visual distinction between renderings on threaded and un-threaded perls.
<<lessSYNOPSIS
perl -MO=Concise[,OPTIONS] foo.pl
use B::Concise qw(set_style add_callback);
This compiler backend prints the internal OPs of a Perl programs syntax tree in one of several space-efficient text formats suitable for debugging the inner workings of perl or other compiler backends. It can print OPs in the order they appear in the OP tree, in the order they will execute, or in a text approximation to their tree structure, and the format of the information displayed is customizable. Its function is similar to that of perls -Dx debugging flag or the B::Terse module, but it is more sophisticated and flexible.
EXAMPLE
Heres an example of 2 outputs (aka renderings), using the -exec and -basic (i.e. default) formatting conventions on the same code snippet.
% perl -MO=Concise,-exec -e $a = $b + 42
1 enter
2 nextstate(main 1 -e:1) v
3 gvsv[*b] s
4 const[IV 42] s
* 5 add[t3] sK/2
6 gvsv[*a] s
7 sassign vKS/2
8 leave[1 ref] vKP/REFC
Each line corresponds to an opcode. The opcode marked with * is used in a few examples below.
The 1st column is the ops sequence number, starting at 1, and is displayed in base 36 by default. This rendering is in -exec (i.e. execution) order.
The symbol between angle brackets indicates the ops type, for example; < 2 > is a BINOP, < @ > a LISTOP, and < # > is a PADOP, which is used in threaded perls. (see "OP class abbreviations").
The opname, as in add[t1], which may be followed by op-specific information in parentheses or brackets (ex [t1]).
The op-flags (ex sK/2) follow, and are described in ("OP flags abbreviations").
% perl -MO=Concise -e $a = $b + 42
8 leave[1 ref] vKP/REFC ->(end)
1 enter ->2
2 nextstate(main 1 -e:1) v ->3
7 sassign vKS/2 ->8
* 5 add[t1] sK/2 ->6
- ex-rv2sv sK/1 ->4
3 gvsv(*b) s ->4
4 const(IV 42) s ->5
- ex-rv2sv sKRM*/1 ->7
6 gvsv(*a) s ->7
The default rendering is top-down, so theyre not in execution order. This form reflects the way the stack is used to parse and evaluate expressions; the add operates on the two terms below it in the tree.
Nullops appear as ex-opname, where opname is an op that has been optimized away by perl. Theyre displayed with a sequence-number of -, because they are not executed (they dont appear in previous example), theyre printed here because they reflect the parse.
The arrow points to the sequence number of the next op; theyre not displayed in -exec mode, for obvious reasons.
Note that because this rendering was done on a non-threaded perl, the PADOPs in the previous examples are now SVOPs, and some (but not all) of the square brackets have been replaced by round ones. This is a subtle feature to provide some visual distinction between renderings on threaded and un-threaded perls.
Download (12.2MB)
Added: 2007-06-25 License: Perl Artistic License Price:
851 downloads
Workrave 1.8.4
Workrave is a program that assists in the recovery and prevention of repetitive strain injury. more>>
Workrave project can assists you in the recovery and prevention of Repetitive Strain Injury (RSI).
The program frequently alerts you to take micro-pauses, rest breaks and restricts you to your daily limit.
Please refer to the feature comparison for a complete list of features, and how the program performs with respect to other programs on the market. The program runs on GNU/Linux and Microsoft Windows.
Main features:
- Distributed: The program runs distributed on one or more PCs. All connected PCs share the same timing information. When the user switches computers, he still will be asked to pause on time.
- Server data collect: All programs in a network report user data detailing break information, mouse and keyboard usage to a central server. The data stored on this server may be analysed to detect user behaviour and, for example, take proactive measures.
- Applet: The program is able to show status information in an applet that is embeddable in the desktop panel or taskbar.
Enhancements:
- Eraldo Girardi translated Workrave into Italian.
- Better support for vertical applets on Unix.
- Tao WEI translated Workrave into simplified Chinese.
- Peter Tuharsky translated Workrave into Slovak.
- Prokopis Prokopidis translated Workrave into Greek.
- The status window used to appear empty, only to be resized and filled with the timers shortly thereafter. Now it appears right away in the proper size.
- The operation mode (normal/quiet/suspended) now persists across Workrave sessions.
- Enver Altin translated Workrave into Turkish.
- Masanobu Yokota translated Workrave into Japanese.
- Ivan Dimov translated Workrave into Bulgarian.
- ORY Mate translated Workrave into Hungarian.
- Fixed KDE sound events (Phuah Yee Keat)
- Fixed Gnome sound events
- Fixed negative mouse usage when date is changed.
- Fixed text color on Gnome themes with dark backgrounds (i.e. high contrast inverse)
- Gnome applets now support transparency.
- The datadir configuration option in workrave.ini can now be a relative path: [general] datadir=.Data This will store all Workrave data in the Data directory below the Workrave root directory. (Note the double backslash)
- Daily limit now properly resets when hibernated.
<<lessThe program frequently alerts you to take micro-pauses, rest breaks and restricts you to your daily limit.
Please refer to the feature comparison for a complete list of features, and how the program performs with respect to other programs on the market. The program runs on GNU/Linux and Microsoft Windows.
Main features:
- Distributed: The program runs distributed on one or more PCs. All connected PCs share the same timing information. When the user switches computers, he still will be asked to pause on time.
- Server data collect: All programs in a network report user data detailing break information, mouse and keyboard usage to a central server. The data stored on this server may be analysed to detect user behaviour and, for example, take proactive measures.
- Applet: The program is able to show status information in an applet that is embeddable in the desktop panel or taskbar.
Enhancements:
- Eraldo Girardi translated Workrave into Italian.
- Better support for vertical applets on Unix.
- Tao WEI translated Workrave into simplified Chinese.
- Peter Tuharsky translated Workrave into Slovak.
- Prokopis Prokopidis translated Workrave into Greek.
- The status window used to appear empty, only to be resized and filled with the timers shortly thereafter. Now it appears right away in the proper size.
- The operation mode (normal/quiet/suspended) now persists across Workrave sessions.
- Enver Altin translated Workrave into Turkish.
- Masanobu Yokota translated Workrave into Japanese.
- Ivan Dimov translated Workrave into Bulgarian.
- ORY Mate translated Workrave into Hungarian.
- Fixed KDE sound events (Phuah Yee Keat)
- Fixed Gnome sound events
- Fixed negative mouse usage when date is changed.
- Fixed text color on Gnome themes with dark backgrounds (i.e. high contrast inverse)
- Gnome applets now support transparency.
- The datadir configuration option in workrave.ini can now be a relative path: [general] datadir=.Data This will store all Workrave data in the Data directory below the Workrave root directory. (Note the double backslash)
- Daily limit now properly resets when hibernated.
Download (1.5MB)
Added: 2007-03-04 License: GPL (GNU General Public License) Price:
970 downloads
B::Terse 5.8.8
B::Terse - Walk Perl syntax tree, printing terse info about ops. more>>
B::Terse - Walk Perl syntax tree, printing terse info about ops.
SYNOPSIS
perl -MO=Terse[,OPTIONS] foo.pl
This version of B::Terse is really just a wrapper that calls B::Concise with the -terse option. It is provided for compatibility with old scripts (and habits) but using B::Concise directly is now recommended instead.
For compatibility with the old B::Terse, this module also adds a method named terse to B::OP and B::SV objects. The B::SV method is largely compatible with the old one, though authors of new software might be advised to choose a more user-friendly output format. The B::OP terse method, however, doesnt work well. Since B::Terse was first written, much more information in OPs has migrated to the scratchpad datastructure, but the terse interface doesnt have any way of getting to the correct pad. As a kludge, the new version will always use the pad for the main program, but for OPs in subroutines this will give the wrong answer or crash.
<<lessSYNOPSIS
perl -MO=Terse[,OPTIONS] foo.pl
This version of B::Terse is really just a wrapper that calls B::Concise with the -terse option. It is provided for compatibility with old scripts (and habits) but using B::Concise directly is now recommended instead.
For compatibility with the old B::Terse, this module also adds a method named terse to B::OP and B::SV objects. The B::SV method is largely compatible with the old one, though authors of new software might be advised to choose a more user-friendly output format. The B::OP terse method, however, doesnt work well. Since B::Terse was first written, much more information in OPs has migrated to the scratchpad datastructure, but the terse interface doesnt have any way of getting to the correct pad. As a kludge, the new version will always use the pad for the main program, but for OPs in subroutines this will give the wrong answer or crash.
Download (12.2MB)
Added: 2007-06-26 License: Perl Artistic License Price:
850 downloads
Darkbot 8
Darkbot is a very fast and small IRC bot written in C. more>>
Darkbot is a very fast and small program written in C language which connects to IRC from an Unix or Windows operating system and automatically "talks" and responds to users questions.
Originally created by Jason Hamilton as an aid for help channels to answer repeated questions from its virtually unlimited database, it has became a very popular talking robot in a generic sense, being used all over IRC networks for different purposes and in 18 languages.
THe dfata can be dynamically added and changed but also can be changed offline, working in its database.
An extensive but easy-to-understand list of commands and features, including some channel operation functions and levels of protection, makes Darkbot a very flexible but somehow powerful and complex robot, with almost human conversations and reactions.
Enhancements:
- Removed an unneeded line in main.c, that was used to "hide" warnings on WIN32, which is a very bad idea.
- Changed check_dbtimers() so it ignores the CVS directory, which contains information for the CVS server. This fixes a situation that seems to have only presented itself in FreeBSD, where it thinks the CVS directory is a timer, and sends out random garble every few seconds.
- configure.ac and source/Makefile.am; very minor updates.
- Fixed randq, which I accidentally broke when adding the
- I switch. This also fixes some problems that turned upon FreeBSD.
- Fixed a warning that came up in permbans.c about mixing types when compiling on OS X. I changed %d on line 198 to %ud.
- configure now checks for clock_t.
- configure now automatically checks for snprintf, and uses a replacement if its not found.
- docs/INSTALL.txt is now INSTALL in the toplevel dir.
- Another thing for automake to stop complaining about.
- The original configure script is now located in the scripts directory, and is called "Setup".
- docs/contributors.txt is now called AUTHORS in the top level of the distribution. Another thing automake complains about. I also worked on the appearance of this file, hopefully it looks a little better now.
- README.txt in the toplevel is now called "README". Automake complains about this file also, if its not found.
- This file is now called ChangeLog, and has been moved to the toplevel distribution dir. The reason for this is that automake complains, if it cant find this file.
- configure now checks for the presence of windows.h, and defines WIN32, if its found. This removes the need to do "make win". Until I add the noconsole option again, you can run darkbot with no console by doing "./darkbot &" in your cygwin shell.
- The configure.ac file is not yet complete, and most of the definitions listed in config.h are not completely implemented into the code yet. If you have problems, please let me know, and these files will become completely implemented as demand is met.
- Included premade Makefiles and configure script.
- Added "make convertdb", which will compile the database conversion utility, which encrypts the passwords in your userlist.db file.
- I added a Makefile.am in the toplevel, and in the source directory. These files are used in conjunction with GNU Automake to produce a Makefile.
- Added Makefile.ams and configure.ac for autoconf/automake.
<<lessOriginally created by Jason Hamilton as an aid for help channels to answer repeated questions from its virtually unlimited database, it has became a very popular talking robot in a generic sense, being used all over IRC networks for different purposes and in 18 languages.
THe dfata can be dynamically added and changed but also can be changed offline, working in its database.
An extensive but easy-to-understand list of commands and features, including some channel operation functions and levels of protection, makes Darkbot a very flexible but somehow powerful and complex robot, with almost human conversations and reactions.
Enhancements:
- Removed an unneeded line in main.c, that was used to "hide" warnings on WIN32, which is a very bad idea.
- Changed check_dbtimers() so it ignores the CVS directory, which contains information for the CVS server. This fixes a situation that seems to have only presented itself in FreeBSD, where it thinks the CVS directory is a timer, and sends out random garble every few seconds.
- configure.ac and source/Makefile.am; very minor updates.
- Fixed randq, which I accidentally broke when adding the
- I switch. This also fixes some problems that turned upon FreeBSD.
- Fixed a warning that came up in permbans.c about mixing types when compiling on OS X. I changed %d on line 198 to %ud.
- configure now checks for clock_t.
- configure now automatically checks for snprintf, and uses a replacement if its not found.
- docs/INSTALL.txt is now INSTALL in the toplevel dir.
- Another thing for automake to stop complaining about.
- The original configure script is now located in the scripts directory, and is called "Setup".
- docs/contributors.txt is now called AUTHORS in the top level of the distribution. Another thing automake complains about. I also worked on the appearance of this file, hopefully it looks a little better now.
- README.txt in the toplevel is now called "README". Automake complains about this file also, if its not found.
- This file is now called ChangeLog, and has been moved to the toplevel distribution dir. The reason for this is that automake complains, if it cant find this file.
- configure now checks for the presence of windows.h, and defines WIN32, if its found. This removes the need to do "make win". Until I add the noconsole option again, you can run darkbot with no console by doing "./darkbot &" in your cygwin shell.
- The configure.ac file is not yet complete, and most of the definitions listed in config.h are not completely implemented into the code yet. If you have problems, please let me know, and these files will become completely implemented as demand is met.
- Included premade Makefiles and configure script.
- Added "make convertdb", which will compile the database conversion utility, which encrypts the passwords in your userlist.db file.
- I added a Makefile.am in the toplevel, and in the source directory. These files are used in conjunction with GNU Automake to produce a Makefile.
- Added Makefile.ams and configure.ac for autoconf/automake.
Download (1.0MB)
Added: 2006-06-19 License: Freeware Price:
1227 downloads
File::Basename 5.8.8
File::Basename is a Perl module to parse file paths into directory, filename and suffix. more>>
File::Basename is a Perl module to parse file paths into directory, filename and suffix.
SYNOPSIS
use File::Basename;
($name,$path,$suffix) = fileparse($fullname,@suffixlist);
$name = fileparse($fullname,@suffixlist);
$basename = basename($fullname,@suffixlist);
$dirname = dirname($fullname);
These routines allow you to parse file paths into their directory, filename and suffix.
NOTE: dirname() and basename() emulate the behaviours, and quirks, of the shell and C functions of the same name. See each functions documentation for details. If your concern is just parsing paths it is safer to use File::Specs splitpath() and splitdir() methods.
It is guaranteed that
# Where $path_separator is / for Unix, for Windows, etc...
dirname($path) . $path_separator . basename($path);
is equivalent to the original path for all systems but VMS.
fileparse
my($filename, $directories, $suffix) = fileparse($path);
my($filename, $directories, $suffix) = fileparse($path, @suffixes);
my $filename = fileparse($path, @suffixes);
The fileparse() routine divides a file path into its $directories, $filename and (optionally) the filename $suffix.
$directories contains everything up to and including the last directory separator in the $path including the volume (if applicable). The remainder of the $path is the $filename.
# On Unix returns ("baz", "/foo/bar/", "")
fileparse("/foo/bar/baz");
# On Windows returns ("baz", "C:foobar", "")
fileparse("C:foobarbaz");
# On Unix returns ("", "/foo/bar/baz/", "")
fileparse("/foo/bar/baz/");
If @suffixes are given each element is a pattern (either a string or a qr//) matched against the end of the $filename. The matching portion is removed and becomes the $suffix.
# On Unix returns ("baz", "/foo/bar", ".txt")
fileparse("/foo/bar/baz", qr/.[^.]*/);
If type is non-Unix (see fileparse_set_fstype()) then the pattern matching for suffix removal is performed case-insensitively, since those systems are not case-sensitive when opening existing files.
You are guaranteed that $directories . $filename . $suffix will denote the same location as the original $path.
basename
my $filename = basename($path);
my $filename = basename($path, @suffixes);
This function is provided for compatibility with the Unix shell command basename(1). It does NOT always return the file name portion of a path as you might expect. To be safe, if you want the file name portion of a path use fileparse().
basename() returns the last level of a filepath even if the last level is clearly directory. In effect, it is acting like pop() for paths. This differs from fileparse()s behaviour.
# Both return "bar"
basename("/foo/bar");
basename("/foo/bar/");
@suffixes work as in fileparse() except all regex metacharacters are quoted.
# These two function calls are equivalent.
my $filename = basename("/foo/bar/baz.txt", ".txt");
my $filename = fileparse("/foo/bar/baz.txt", qr/Q.txtE/);
Also note that in order to be compatible with the shell command, basename() does not strip off a suffix if it is identical to the remaining characters in the filename.
dirname
This function is provided for compatibility with the Unix shell command dirname(1) and has inherited some of its quirks. In spite of its name it does NOT always return the directory name as you might expect. To be safe, if you want the directory name of a path use fileparse().
Only on VMS (where there is no ambiguity between the file and directory portions of a path) and AmigaOS (possibly due to an implementation quirk in this module) does dirname() work like fileparse($path), returning just the $directories.
# On VMS and AmigaOS
my $directories = dirname($path);
When using Unix or MSDOS syntax this emulates the dirname(1) shell function which is subtly different from how fileparse() works. It returns all but the last level of a file path even if the last level is clearly a directory. In effect, it is not returning the directory portion but simply the path one level up acting like chop() for file paths.
Also unlike fileparse(), dirname() does not include a trailing slash on its returned path.
# returns /foo/bar. fileparse() would return /foo/bar/
dirname("/foo/bar/baz");
# also returns /foo/bar despite the fact that baz is clearly a
# directory. fileparse() would return /foo/bar/baz/
dirname("/foo/bar/baz/");
# returns .. fileparse() would return foo/
dirname("foo/");
Under VMS, if there is no directory information in the $path, then the current default device and directory is used.
fileparse_set_fstype
my $type = fileparse_set_fstype();
my $previous_type = fileparse_set_fstype($type);
Normally File::Basename will assume a file path type native to your current operating system (ie. /foo/bar style on Unix, foobar on Windows, etc...). With this function you can override that assumption.
Valid $types are "MacOS", "VMS", "AmigaOS", "OS2", "RISCOS", "MSWin32", "DOS" (also "MSDOS" for backwards bug compatibility), "Epoc" and "Unix" (all case-insensitive). If an unrecognized $type is given "Unix" will be assumed.
If youve selected VMS syntax, and the file specification you pass to one of these routines contains a "/", they assume you are using Unix emulation and apply the Unix syntax rules instead, for that function call only.
<<lessSYNOPSIS
use File::Basename;
($name,$path,$suffix) = fileparse($fullname,@suffixlist);
$name = fileparse($fullname,@suffixlist);
$basename = basename($fullname,@suffixlist);
$dirname = dirname($fullname);
These routines allow you to parse file paths into their directory, filename and suffix.
NOTE: dirname() and basename() emulate the behaviours, and quirks, of the shell and C functions of the same name. See each functions documentation for details. If your concern is just parsing paths it is safer to use File::Specs splitpath() and splitdir() methods.
It is guaranteed that
# Where $path_separator is / for Unix, for Windows, etc...
dirname($path) . $path_separator . basename($path);
is equivalent to the original path for all systems but VMS.
fileparse
my($filename, $directories, $suffix) = fileparse($path);
my($filename, $directories, $suffix) = fileparse($path, @suffixes);
my $filename = fileparse($path, @suffixes);
The fileparse() routine divides a file path into its $directories, $filename and (optionally) the filename $suffix.
$directories contains everything up to and including the last directory separator in the $path including the volume (if applicable). The remainder of the $path is the $filename.
# On Unix returns ("baz", "/foo/bar/", "")
fileparse("/foo/bar/baz");
# On Windows returns ("baz", "C:foobar", "")
fileparse("C:foobarbaz");
# On Unix returns ("", "/foo/bar/baz/", "")
fileparse("/foo/bar/baz/");
If @suffixes are given each element is a pattern (either a string or a qr//) matched against the end of the $filename. The matching portion is removed and becomes the $suffix.
# On Unix returns ("baz", "/foo/bar", ".txt")
fileparse("/foo/bar/baz", qr/.[^.]*/);
If type is non-Unix (see fileparse_set_fstype()) then the pattern matching for suffix removal is performed case-insensitively, since those systems are not case-sensitive when opening existing files.
You are guaranteed that $directories . $filename . $suffix will denote the same location as the original $path.
basename
my $filename = basename($path);
my $filename = basename($path, @suffixes);
This function is provided for compatibility with the Unix shell command basename(1). It does NOT always return the file name portion of a path as you might expect. To be safe, if you want the file name portion of a path use fileparse().
basename() returns the last level of a filepath even if the last level is clearly directory. In effect, it is acting like pop() for paths. This differs from fileparse()s behaviour.
# Both return "bar"
basename("/foo/bar");
basename("/foo/bar/");
@suffixes work as in fileparse() except all regex metacharacters are quoted.
# These two function calls are equivalent.
my $filename = basename("/foo/bar/baz.txt", ".txt");
my $filename = fileparse("/foo/bar/baz.txt", qr/Q.txtE/);
Also note that in order to be compatible with the shell command, basename() does not strip off a suffix if it is identical to the remaining characters in the filename.
dirname
This function is provided for compatibility with the Unix shell command dirname(1) and has inherited some of its quirks. In spite of its name it does NOT always return the directory name as you might expect. To be safe, if you want the directory name of a path use fileparse().
Only on VMS (where there is no ambiguity between the file and directory portions of a path) and AmigaOS (possibly due to an implementation quirk in this module) does dirname() work like fileparse($path), returning just the $directories.
# On VMS and AmigaOS
my $directories = dirname($path);
When using Unix or MSDOS syntax this emulates the dirname(1) shell function which is subtly different from how fileparse() works. It returns all but the last level of a file path even if the last level is clearly a directory. In effect, it is not returning the directory portion but simply the path one level up acting like chop() for file paths.
Also unlike fileparse(), dirname() does not include a trailing slash on its returned path.
# returns /foo/bar. fileparse() would return /foo/bar/
dirname("/foo/bar/baz");
# also returns /foo/bar despite the fact that baz is clearly a
# directory. fileparse() would return /foo/bar/baz/
dirname("/foo/bar/baz/");
# returns .. fileparse() would return foo/
dirname("foo/");
Under VMS, if there is no directory information in the $path, then the current default device and directory is used.
fileparse_set_fstype
my $type = fileparse_set_fstype();
my $previous_type = fileparse_set_fstype($type);
Normally File::Basename will assume a file path type native to your current operating system (ie. /foo/bar style on Unix, foobar on Windows, etc...). With this function you can override that assumption.
Valid $types are "MacOS", "VMS", "AmigaOS", "OS2", "RISCOS", "MSWin32", "DOS" (also "MSDOS" for backwards bug compatibility), "Epoc" and "Unix" (all case-insensitive). If an unrecognized $type is given "Unix" will be assumed.
If youve selected VMS syntax, and the file specification you pass to one of these routines contains a "/", they assume you are using Unix emulation and apply the Unix syntax rules instead, for that function call only.
Download (12.2MB)
Added: 2007-04-25 License: Perl Artistic License Price:
912 downloads
xbindkeys 1.8.2
xbindkeys is an events grabbing program for X windows. more>>
xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Window.
xbindkeys links commands to keys or mouse buttons, using a configuration file. Its independant of the window manager and can capture all keyboard keys (ex: Power, Wake...).
usage: [--version|-V] [--defaults|-d] [--file|-f file] [--help|-h] [--display|-X display-name] [--vebose|-v] [--show|-s] [--key|-k] [--multikey|-mk] [--geometry|-g geom]
-V, --version Print version and exit
-d, --defaults Print a default rc file
-f, --file Use an alternative rc file
-h, --help This help!
-X, --display Set X display to use
-v, --verbose More information on xbindkeys when it run
-s, --show Show the actual keybinding
-k, --key Identify one key pressed
-mk, --multikey Identify multi key pressed
-g, --geometry size and position of window open with -k|-mk option
-n, --nodaemon dont start as daemon
Installation
Download the source (See the download section).
Open a text console (for example, xterm).
Change to the directory into which you downloaded the source.
cd source_download_directory
Uncompress the source :
tar xzvf xbindkeys-1.x.x.tar.gz
Change to the new directory (created by tar) :
cd xbindkeys-1.x.x
Compile the program :
make
Install the program (as root if necessary) :
su root
make install
exit
Configure the program :
see the Configuration section.
You can now use xbindkeys by typing :
xbindkeys &
or by loading it automatically when X starts up by adding the preceeding line to the file $HOME/.xsession.
On Mandrake (and maybe Redhat), this method doesnt works.
Instead you can use : Configuration -> Gnome -> Advanced -> Session -> Startup Programs on Mandrake
or Gnome menu -> Settings -> Session -> Session Properties on Redhat.
Enhancements:
- Correction of typos in the man page.
- An emphasis is made on the documentation about the Guile/Scheme configuration file (the preferred way for non-trivial configuration, and far more powerful than the default configuration file).
<<lessxbindkeys links commands to keys or mouse buttons, using a configuration file. Its independant of the window manager and can capture all keyboard keys (ex: Power, Wake...).
usage: [--version|-V] [--defaults|-d] [--file|-f file] [--help|-h] [--display|-X display-name] [--vebose|-v] [--show|-s] [--key|-k] [--multikey|-mk] [--geometry|-g geom]
-V, --version Print version and exit
-d, --defaults Print a default rc file
-f, --file Use an alternative rc file
-h, --help This help!
-X, --display Set X display to use
-v, --verbose More information on xbindkeys when it run
-s, --show Show the actual keybinding
-k, --key Identify one key pressed
-mk, --multikey Identify multi key pressed
-g, --geometry size and position of window open with -k|-mk option
-n, --nodaemon dont start as daemon
Installation
Download the source (See the download section).
Open a text console (for example, xterm).
Change to the directory into which you downloaded the source.
cd source_download_directory
Uncompress the source :
tar xzvf xbindkeys-1.x.x.tar.gz
Change to the new directory (created by tar) :
cd xbindkeys-1.x.x
Compile the program :
make
Install the program (as root if necessary) :
su root
make install
exit
Configure the program :
see the Configuration section.
You can now use xbindkeys by typing :
xbindkeys &
or by loading it automatically when X starts up by adding the preceeding line to the file $HOME/.xsession.
On Mandrake (and maybe Redhat), this method doesnt works.
Instead you can use : Configuration -> Gnome -> Advanced -> Session -> Startup Programs on Mandrake
or Gnome menu -> Settings -> Session -> Session Properties on Redhat.
Enhancements:
- Correction of typos in the man page.
- An emphasis is made on the documentation about the Guile/Scheme configuration file (the preferred way for non-trivial configuration, and far more powerful than the default configuration file).
Download (0.12MB)
Added: 2007-04-19 License: GPL (GNU General Public License) Price:
920 downloads
DirHandle 5.8.8
DirHandle is a Perl module created to supply object methods for directory handles. more>>
DirHandle is a Perl module created to supply object methods for directory handles.
SYNOPSIS
use DirHandle;
$d = new DirHandle ".";
if (defined $d) {
while (defined($_ = $d->read)) { something($_); }
$d->rewind;
while (defined($_ = $d->read)) { something_else($_); }
undef $d;
}
The DirHandle method provide an alternative interface to the opendir(), closedir(), readdir(), and rewinddir() functions.
The only objective benefit to using DirHandle is that it avoids namespace pollution by creating globs to hold directory handles.
NOTES
On Mac OS (Classic), the path separator is :, not /, and the current directory is denoted as :, not .. You should be careful about specifying relative pathnames. While a full path always begins with a volume name, a relative pathname should always begin with a :. If specifying a volume name only, a trailing : is required.
<<lessSYNOPSIS
use DirHandle;
$d = new DirHandle ".";
if (defined $d) {
while (defined($_ = $d->read)) { something($_); }
$d->rewind;
while (defined($_ = $d->read)) { something_else($_); }
undef $d;
}
The DirHandle method provide an alternative interface to the opendir(), closedir(), readdir(), and rewinddir() functions.
The only objective benefit to using DirHandle is that it avoids namespace pollution by creating globs to hold directory handles.
NOTES
On Mac OS (Classic), the path separator is :, not /, and the current directory is denoted as :, not .. You should be careful about specifying relative pathnames. While a full path always begins with a volume name, a relative pathname should always begin with a :. If specifying a volume name only, a trailing : is required.
Download (12.2MB)
Added: 2007-05-15 License: Perl Artistic License Price:
895 downloads
Benchmark 5.8.8
Benchmark is a Perl module with benchmark running times of Perl code. more>>
Benchmark is a Perl module with benchmark running times of Perl code.
SYNOPSIS
use Benchmark qw(:all) ;
timethis ($count, "code");
# Use Perl code in strings...
timethese($count, {
Name1 => ...code1...,
Name2 => ...code2...,
});
# ... or use subroutine references.
timethese($count, {
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
});
# cmpthese can be used both ways as well
cmpthese($count, {
Name1 => ...code1...,
Name2 => ...code2...,
});
cmpthese($count, {
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
});
# ...or in two stages
$results = timethese($count,
{
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
},
none
);
cmpthese( $results ) ;
$t = timeit($count, ...other code...)
print "$count loops of other code took:",timestr($t),"n";
$t = countit($time, ...other code...)
$count = $t->iters ;
print "$count loops of other code took:",timestr($t),"n";
# enable hires wallclock timing if possible
use Benchmark :hireswallclock;
The Benchmark module encapsulates a number of routines to help you figure out how long it takes to execute some code.
timethis - run a chunk of code several times
timethese - run several chunks of code several times
cmpthese - print results of timethese as a comparison chart
timeit - run a chunk of code and see how long it goes
countit - see how many times a chunk of code runs in a given time
<<lessSYNOPSIS
use Benchmark qw(:all) ;
timethis ($count, "code");
# Use Perl code in strings...
timethese($count, {
Name1 => ...code1...,
Name2 => ...code2...,
});
# ... or use subroutine references.
timethese($count, {
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
});
# cmpthese can be used both ways as well
cmpthese($count, {
Name1 => ...code1...,
Name2 => ...code2...,
});
cmpthese($count, {
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
});
# ...or in two stages
$results = timethese($count,
{
Name1 => sub { ...code1... },
Name2 => sub { ...code2... },
},
none
);
cmpthese( $results ) ;
$t = timeit($count, ...other code...)
print "$count loops of other code took:",timestr($t),"n";
$t = countit($time, ...other code...)
$count = $t->iters ;
print "$count loops of other code took:",timestr($t),"n";
# enable hires wallclock timing if possible
use Benchmark :hireswallclock;
The Benchmark module encapsulates a number of routines to help you figure out how long it takes to execute some code.
timethis - run a chunk of code several times
timethese - run several chunks of code several times
cmpthese - print results of timethese as a comparison chart
timeit - run a chunk of code and see how long it goes
countit - see how many times a chunk of code runs in a given time
Download (12.2MB)
Added: 2007-05-15 License: Perl Artistic License Price:
1240 downloads
AutoSplit 5.8.8
AutoSplit is a Perl module that can split a package for autoloading. more>>
AutoSplit is a Perl module that can split a package for autoloading.
SYNOPSIS
autosplit($file, $dir, $keep, $check, $modtime);
autosplit_lib_modules(@modules);
This function will split up your program into files that the AutoLoader module can handle. It is used by both the standard perl libraries and by the MakeMaker utility, to automatically configure libraries for autoloading.
The autosplit interface splits the specified file into a hierarchy rooted at the directory $dir. It creates directories as needed to reflect class hierarchy, and creates the file autosplit.ix. This file acts as both forward declaration of all package routines, and as timestamp for the last update of the hierarchy.
The remaining three arguments to autosplit govern other options to the autosplitter.
$keep
If the third argument, $keep, is false, then any pre-existing *.al files in the autoload directory are removed if they are no longer part of the module (obsoleted functions). $keep defaults to 0.
$check
The fourth argument, $check, instructs autosplit to check the module currently being split to ensure that it includes a use specification for the AutoLoader module, and skips the module if AutoLoader is not detected. $check defaults to 1.
$modtime
Lastly, the $modtime argument specifies that autosplit is to check the modification time of the module against that of the autosplit.ix file, and only split the module if it is newer. $modtime defaults to 1.
Typical use of AutoSplit in the perl MakeMaker utility is via the command-line with:
perl -e use AutoSplit; autosplit($ARGV[0], $ARGV[1], 0, 1, 1)
Defined as a Make macro, it is invoked with file and directory arguments; autosplit will split the specified file into the specified directory and delete obsolete .al files, after checking first that the module does use the AutoLoader, and ensuring that the module is not already currently split in its current form (the modtime test).
The autosplit_lib_modules form is used in the building of perl. It takes as input a list of files (modules) that are assumed to reside in a directory lib relative to the current directory. Each file is sent to the autosplitter one at a time, to be split into the directory lib/auto.
In both usages of the autosplitter, only subroutines defined following the perl __END__ token are split out into separate files. Some routines may be placed prior to this marker to force their immediate loading and parsing.
Multiple packages
As of version 1.01 of the AutoSplit module it is possible to have multiple packages within a single file. Both of the following cases are supported:
package NAME;
__END__
sub AAA { ... }
package NAME::option1;
sub BBB { ... }
package NAME::option2;
sub BBB { ... }
package NAME;
__END__
sub AAA { ... }
sub NAME::option1::BBB { ... }
sub NAME::option2::BBB { ... }
<<lessSYNOPSIS
autosplit($file, $dir, $keep, $check, $modtime);
autosplit_lib_modules(@modules);
This function will split up your program into files that the AutoLoader module can handle. It is used by both the standard perl libraries and by the MakeMaker utility, to automatically configure libraries for autoloading.
The autosplit interface splits the specified file into a hierarchy rooted at the directory $dir. It creates directories as needed to reflect class hierarchy, and creates the file autosplit.ix. This file acts as both forward declaration of all package routines, and as timestamp for the last update of the hierarchy.
The remaining three arguments to autosplit govern other options to the autosplitter.
$keep
If the third argument, $keep, is false, then any pre-existing *.al files in the autoload directory are removed if they are no longer part of the module (obsoleted functions). $keep defaults to 0.
$check
The fourth argument, $check, instructs autosplit to check the module currently being split to ensure that it includes a use specification for the AutoLoader module, and skips the module if AutoLoader is not detected. $check defaults to 1.
$modtime
Lastly, the $modtime argument specifies that autosplit is to check the modification time of the module against that of the autosplit.ix file, and only split the module if it is newer. $modtime defaults to 1.
Typical use of AutoSplit in the perl MakeMaker utility is via the command-line with:
perl -e use AutoSplit; autosplit($ARGV[0], $ARGV[1], 0, 1, 1)
Defined as a Make macro, it is invoked with file and directory arguments; autosplit will split the specified file into the specified directory and delete obsolete .al files, after checking first that the module does use the AutoLoader, and ensuring that the module is not already currently split in its current form (the modtime test).
The autosplit_lib_modules form is used in the building of perl. It takes as input a list of files (modules) that are assumed to reside in a directory lib relative to the current directory. Each file is sent to the autosplitter one at a time, to be split into the directory lib/auto.
In both usages of the autosplitter, only subroutines defined following the perl __END__ token are split out into separate files. Some routines may be placed prior to this marker to force their immediate loading and parsing.
Multiple packages
As of version 1.01 of the AutoSplit module it is possible to have multiple packages within a single file. Both of the following cases are supported:
package NAME;
__END__
sub AAA { ... }
package NAME::option1;
sub BBB { ... }
package NAME::option2;
sub BBB { ... }
package NAME;
__END__
sub AAA { ... }
sub NAME::option1::BBB { ... }
sub NAME::option2::BBB { ... }
Download (12.2MB)
Added: 2007-05-08 License: Perl Artistic License Price:
904 downloads
DBAHelper 0.1.8
DBAHelper is a collection of scripts to ease the daily maintenance work of Oracle database administrators. more>>
DBAHelper project is a collection of scripts to ease the daily maintenance work of Oracle database administrators.
Examples are moving objects between tablespaces, analyzing schemata, and rebuilding invalid indices.
Enhancements:
- Some fixes to the Generate_createDB.sh.
- An RMAN framework has been added to simplify RMAN usage (requires 10g with Recovery Area enabled and properly sized to hold the backups).
<<lessExamples are moving objects between tablespaces, analyzing schemata, and rebuilding invalid indices.
Enhancements:
- Some fixes to the Generate_createDB.sh.
- An RMAN framework has been added to simplify RMAN usage (requires 10g with Recovery Area enabled and properly sized to hold the backups).
Download (0.033MB)
Added: 2007-07-17 License: GPL (GNU General Public License) Price:
833 downloads
buzhug 0.8
buzhug is a fast, pure-Python database engine, using a syntax that Python programmers should find very intuitive. more>>
buzhug is a fast, pure-Python database engine, using a syntax that Python programmers should find very intuitive.
The data is stored and accessed on disk (it is not an in-memory database) ; the implementation has been designed to make all operations, and especially selection, as fast as possible with an interpreted language.
The database is implemented as a Python iterator, yielding objects whose attributes are the fields defined when the base is created ; therefore, requests can be expressed as list comprehensions or generator expressions, instead of SQL queries :
for record in [ r for r in db if r.name == pierre ]
print record.name,record.age
instead of
cursor.execute("SELECT * IN db WHERE name = pierre")
for r in cursor.fetchall():
print r[0],r[1]
List comprehension is only one of the different ways to select records ; direct access by record identifier is almost immediate regardless of the size of the base, and the algorithms used in the select() method make selections extremely fast in most cases.
buzhug supports concurrency control by versioning, cleanup of unused data when many records have been deleted, easy links between bases, adding and removing fields on an existing base, etc.
Database speed comparisons are not easy to make. I made a limited benchmark using the same use cases as SQLites author ; it shows that buzhug is much faster than other pure-Python modules (KirbyBase, gadfly) ; SQLite, which is implemented in C, is faster, but only less than 3 times on the average.
buzhug is an Open Source software, published under the revised BSD licence.
Enhancements:
- Small bug fix in links between bases
<<lessThe data is stored and accessed on disk (it is not an in-memory database) ; the implementation has been designed to make all operations, and especially selection, as fast as possible with an interpreted language.
The database is implemented as a Python iterator, yielding objects whose attributes are the fields defined when the base is created ; therefore, requests can be expressed as list comprehensions or generator expressions, instead of SQL queries :
for record in [ r for r in db if r.name == pierre ]
print record.name,record.age
instead of
cursor.execute("SELECT * IN db WHERE name = pierre")
for r in cursor.fetchall():
print r[0],r[1]
List comprehension is only one of the different ways to select records ; direct access by record identifier is almost immediate regardless of the size of the base, and the algorithms used in the select() method make selections extremely fast in most cases.
buzhug supports concurrency control by versioning, cleanup of unused data when many records have been deleted, easy links between bases, adding and removing fields on an existing base, etc.
Database speed comparisons are not easy to make. I made a limited benchmark using the same use cases as SQLites author ; it shows that buzhug is much faster than other pure-Python modules (KirbyBase, gadfly) ; SQLite, which is implemented in C, is faster, but only less than 3 times on the average.
buzhug is an Open Source software, published under the revised BSD licence.
Enhancements:
- Small bug fix in links between bases
Download (0.049MB)
Added: 2007-06-02 License: BSD License Price:
875 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
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above borang spa 8 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