Subroutine Redefined
Sub::PatMat can call a version of subroutine depending on its arguments. SYNOPSIS use Sub::PatMat; # basics: sub fact : when($_[0] <= 1) { 1 } sub fact { my ($n) = @_; $n*fact($n-1) } print fact(6); # referring to things other than @_: sub mysort : when($a < $b) { -1 } sub mysort :...
Platforms: *nix
License: Freeware | Size: 14.34 KB | Download (92): Sub::PatMat Download |
Test::Resub is a lexically scoped subroutine replacement for testing. SYNOPSIS #!/usr/bin/perl use Test::More tests => 4; use Test::Resub qw(resub); { package Somewhere; sub show { my ($class, $message) = @_; return "$class, $message"; } } # sanity is( Somewhere->show(beyond the...
Platforms: *nix
License: Freeware | Size: 14.34 KB | Download (93): Test::Resub Download |
Perl6::Currying is a Perl 6 subroutine currying for Perl 5. SYNOPSIS use Perl6::Currying; sub add ($a,$b) { $a + $b } # Define a sub with named params print add(1,2); # Call it my $incr = &add.prebind(a=>1); # Bind the $a argument to 1 # to create an increment subroutine print...
Platforms: *nix
License: Freeware | Size: 5.12 KB | Download (89): Perl6::Currying Download |
B::LexInfo is a Perl module that shows information about subroutine lexical variables. SYNOPSIS use B::ShowLex (); my $lexi = B::ShowLex->new; Perl stores lexical variable names and values inside a padlist within the subroutine. Certain lexicals will maintain certain attributes after the...
Platforms: *nix
License: Freeware | Size: 5.12 KB | Download (94): B::LexInfo Download |
Hook::Filter is a runtime filtering layer on top of subroutine calls. SYNOPSIS Imagine you have a big program using a logging library that exports 3 functions called mydebug, myinfo and mywarn. Those functions generate far too much log, so you want to skip calling them except in some specific...
Platforms: *nix
License: Freeware | Size: 15.36 KB | Download (101): Hook::Filter Download |
Debug::Trace is a Perl extension to trace subroutine calls. SYNOPSIS perl -MDebug::Trace=foo,bar yourprogram.pl Debug::Trace instruments subroutines to provide tracing information upon every call and return. Using Debug::Trace does not require any changes to your sources. Most often, it...
Platforms: *nix
License: Freeware | Size: 5.12 KB | Download (163): Debug::Trace Download |
Code::Splice injects the contents of one subroutine at a specified point elsewhere. SYNOPSIS use Code::Splice; Code::Splice::inject( code => sub { print "fredn"; }, package => main, method => foo, precondition => sub { my $op = shift; my $line = shift; $line =~ m/print/ and $line =~...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (98): Code::Splice Download |
This script is a translation of the Fortran subroutine RANKSB.
Platforms: Windows, Mac, *nix, Python, BSD Solaris
License: Freeware | Download (51): Choose a random k-subset of {1,2, ..., n} Download |
This software will make you the "coolest kid on the block" so to speak! It turns your computer into a powerful web messaging machine: allowing you to keep in constant touch with your buddies/ family in a very dynamic way. Think of it this way: you have the ability to create a "TV channel"...
Platforms: Windows
License: Freeware | Size: 20 MB | Download (96): Cool Redefined Download |
AtExit is a Perl module that can perform exit processing for a program or object. SYNOPSIS use AtExit; sub cleanup { my @args = @_; print "cleanup() executing: args = @argsn"; } ## Register subroutines to be called when this program exits $_ = atexit(&cleanup, "This call was...
Platforms: *nix
License: Freeware | Size: 8.19 KB | Download (89): AtExit Download |
Hook::Scope is a Perl extension for adding hooks for exiting a scope. SYNOPSIS use Hook::Scope; { Hook::Scope::POST(sub { print "I just left my scope"}); print "you will see this first!"; } use Hook::Scope qw(POST PRE); # only POST can be exported { POST { print "foo" }; POST sub {...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (97): Hook::Scope Download |
Devel::TraceMethods is a Perl module for tracing module calls. SYNOPSIS use Devel::TraceMethods qw( PackageOne PackageTwo ); Devel::TraceMethods allows you to attach a logging subroutine of your choosing to all of the methods and functions within multiple packages or classes. You can use...
Platforms: *nix
License: Freeware | Size: 5.12 KB | Download (90): Devel::TraceMethods Download |
Gtk2::Ex::MindMapView::Connection is a Perl module to draw connections between view items. HEIRARCHY Glib::Object +----Gtk2::Object +----Gnome2::Canvas::Item +----Gnome2::Canvas::Shape +----Gnome2::Canvas::Bpath +----Gtk2::Ex::MindMapView::Connection SYNOPSIS use...
Platforms: *nix
License: Freeware | Size: 50.18 KB | Download (89): Gtk2::Ex::MindMapView::Connection Download |
B::TerseSize is a Perl module that prints information about ops and their (estimated) size. SYNOPSIS perl -MO=TerseSize[,OPTIONS] foo.pl The B::Size and B::TerseSize modules attempt to measure the size of Perl op codes. The output of B::TerseSize is similar to that of B::Terse, but includes...
Platforms: *nix
License: Freeware | Size: 10.24 KB | Download (101): B::TerseSize Download |
Getargs::Long is a Perl module with named subroutine arguments, with optional type checking. SYNOPSIS use Getargs::Long; # case sensitive use Getargs::Long qw(ignorecase); # case insensitive # Simple, args mandatory my ($val, $other) = getargs(@_, qw(val other)); # Simple, args optional...
Platforms: *nix
License: Freeware | Size: 40.96 KB | Download (90): Getargs::Long Download |
IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. SYNOPSIS # Module which provides 2 methods: getSubroutineProducer # and getSystemProducer. They take a subroutine reference # (with associated arguments) and a system call #...
Platforms: *nix
License: Freeware | Size: 6.14 KB | Download (101): IO::Pipe::Producer Download |
SelfLoader is a Perl module created to load functions only on demand. SYNOPSIS package FOOBAR; use SelfLoader; ... (initializing code) __DATA__ sub {.... This module tells its users that functions in the FOOBAR package are to be autoloaded from after the __DATA__ token. See also...
Platforms: *nix
License: Freeware | Size: 12.2 MB | Download (90): SelfLoader Download |
File::Maker is a Perl module that mimics a make by loading a database and calling targets methods. SYNOPSIS ##### # Subroutine interface # use File::Maker qw(load_db); %data = load_db($pm); ###### # Object interface # require File::Maker; $maker = $maker->load_db($pm);...
Platforms: *nix
License: Freeware | Size: 77.82 KB | Download (102): File::Maker Download |
SYNOPSIS ###### # Subroutine interface # use Data::Startup qw(config override); $options = override(%default_options, @option_list ); $options = override(%default_options, @option_list ); $options = override(%default_options, %option_list ); @options_list = config(%options ); ($key,...
Platforms: *nix
License: Freeware | Size: 74.75 KB | Download (101): Data::Startup Download |
SYNOPSIS ##### # Subroutines # use Tie::Layers qw(is_handle config); $yes = is_handle( $file_handle ); ($key, $old_value) = config(%options, $key); ($key, $old_value) = config(%options, $key => $new_value ); #### # Config default startup options # @old_options_list =...
Platforms: *nix
License: Freeware | Size: 71.68 KB | Download (90): Tie::Layers Download |