Main > Free Download Search >

Free args software for linux

args

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 178
Getargs::Long 1.1001

Getargs::Long 1.1001


Getargs::Long is a Perl module with named subroutine arguments, with optional type checking. more>>
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 (in [] means optional)
my ($val, $other) = getargs(@_, [qw(val other)]);

# Simple with typechecking, args mandatory
my ($val, $other) = getargs(@_, qw(val=Class::X other=ARRAY));

# Simple with typechecking, args optional
my ($val, $other) = getargs(@_, [qw(val=Class::X other=ARRAY)]);

# Faster version, building dedicated argument parsing routine
my ($val, $other) = cgetargs(@_, qw(val other));

# Other cases, use full specs:
my ($x, $y, $z, $a, $b, $c) = xgetargs(@_,

# Non-mandatory, defaults to undef unless specified otherwise
x => [i], # integer, no default
y => [ARRAY, [a, b]], # Has a default
z => [], # No typecheck, can be anything

# Mandatory arguments
a => i, # integer (scalar)
b => TYPE, # TYPE or any heir of TYPE
c => undef, # unspecified type but mandatory
);

# Extract remaining unparsed args in @extra
my ($val, $other, @extra) = getargs(@_, { -strict => 0 }, qw(val other));

# Alter behaviour of the getargs() routines via switches in hashref
my ($val, $other) = getargs(@_,
{
-strict => 1, # unknown switches are fatal
-ignorecase => 1, # override packages global
-inplace => 1, # edit @_ inplace: remove parsed args
-extra => 0, # suppress return of extra arguments
},
qw(val other)
);

The Getargs::Long module allows usage of named parameters in function calls, along with optional argument type-checking. It provides an easy way to get at the parameters within the routine, and yields concise descriptions for the common cases of all-mandatory and all-optional parameter lists.

The validation of arguments can be done by a structure-driven routine getargs() which is fine for infrequently called routines (but should be slower), or via a dedicated routine created and compiled on the fly the fist time it is needed, by using the cgetargs() family (expected to be faster).

The Log::Agent module is used to report errors, which leaves to the application the choice of the final logging method: to a file, to STDERR, or to syslog.

<<less
Download (0.040MB)
Added: 2006-09-26 License: Perl Artistic License Price:
1123 downloads
Getopt::GetArgs 1.03

Getopt::GetArgs 1.03


GetArgs is a Perl module to allow enhanced argument passing. more>>
GetArgs is a Perl module to allow enhanced argument passing, including passing of case-insensitive named arguments as well as positioned arguments.

SYNOPSIS

sub WHATEVER {
my @DEFAULT_ARGS =
( Content => "Default content",
Verbose => 0
);
my %ARGS=GetArgs(@_,@DEFAULT_ARGS);
# do some stuff with $ARGS{Content}
# show all kinds of detail if $ARGS{Verbose}
}

# a simple call to WHATEVER
WHATEVER( "Just deal with my content" );

# a flexible call to WHATEVER
WHATEVER({ verbose => 1,
content => "This is my content",
});

GetArgs needs to know * what your subroutine was passed, * and what it expected to be passed. * If you like, you can also supply default values to use when an argument is not passed.

Using this information, GetArgs will create a hash of arguments for you to use throughout your subroutine. Using GetArgs has several advantages:

1) Calls to your subroutine can pass named arguments, making the code more readable.
2) If its easier to pass a list of arguments as you normally would, thats fine.
3) With GetArgs your use of arguments in your subroutine code is more readable.
4) Your subroutines are no longer limited in the number of arguments they expect.
5) Arguments can be passed in any order (if passed inside the hash ref), thus only the arguments relevant to that call need to be passed--unnecessary arguments can be ignored.
6) Case is not important, as GetArgs matches argument names case insensitively.

<<less
Download (0.004MB)
Added: 2007-04-11 License: Perl Artistic License Price:
926 downloads
PAR::WebStart 0.18

PAR::WebStart 0.18


PAR::WebStart is a Perl implementation of Javas WebStart. more>>
PAR::WebStart is a Perl implementation of Javas WebStart.

SYNOPSIS

my $file = hello.pnlp;
my $ws = PAR::WebStart->new(file => $file);
$ws->fetch_pars() or die $ws->{ERROR};

my $tmpdir = $ws->{tmpdir};
chdir($tmpdir) or die qq{Cannot chdir to "$tmpdir": $!});

my @args = @{$ws->run_command()};
die qq{Failed to get WebStart args: $ws->{ERROR}}) unless (@args);
system(@args) == 0 or die qq{Execution of system(@args) failed: $?};

This a Perl version of Javas WebStart technology; see http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/overview.html for details.

PAR-WebStart is a helper application associated with a browser. When a user clicks on a link that points to a PNLP [PAR Network Launch Protocol] launch file (a special XML file), it causes the browser to launch PAR-WebStart, which then automatically downloads, caches, and runs the specified PAR-based application.

<<less
Download (0.023MB)
Added: 2007-03-23 License: Perl Artistic License Price:
945 downloads
Bio::AlignIO::msf 1.4

Bio::AlignIO::msf 1.4


Bio::AlignIO::msf is a Perl module with msf sequence input/output stream. more>>
Bio::AlignIO::msf is a Perl module with msf sequence input/output stream.

SYNOPSIS

Do not use this module directly. Use it via the Bio::AlignIO class.

This object can transform Bio::Align::AlignI objects to and from msf flat file databases.

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

next_aln

Title : next_aln
Usage : $aln = $stream->next_aln()
Function: returns the next alignment in the stream. Tries to read *all* MSF
It reads all non whitespace characters in the alignment
area. For MSFs with weird gaps (eg ~~~) map them by using
$al->map_chars(~,-)
Returns : L< Bio::Align::AlignI > object
Args : NONE

write_aln

Title : write_aln
Usage : $stream->write_aln(@aln)
Function: writes the $aln object into the stream in MSF format
Sequence type of the alignment is determined by the first sequence.
Returns : 1 for success and 0 for error
Args : L< Bio::Align::AlignI > object

<<less
Download (4.7MB)
Added: 2006-09-29 License: Perl Artistic License Price:
1121 downloads
Template::Plugins 2.19

Template::Plugins 2.19


Template::Plugins is a Perl module with plugin provider module. more>>
Template::Plugins is a Perl module with plugin provider.

SYNOPSIS

use Template::Plugins;

$plugin_provider = Template::Plugins->new(%options);

($plugin, $error) = $plugin_provider->fetch($name, @args);

The Template::Plugins module defines a provider class which can be used to load and instantiate Template Toolkit plugin modules.

<<less
Download (0.76MB)
Added: 2007-08-08 License: Perl Artistic License Price:
807 downloads
Catalyst 5.7007

Catalyst 5.7007


Catalyst is a Perl module that contains the elegant MVC web application framework. more>>
Catalyst is a Perl module that contains the elegant MVC web application framework.

SYNOPSIS

See the Catalyst::Manual distribution for comprehensive documentation and tutorials.

# Install Catalyst::Devel for helpers and other development tools
# use the helper to create a new application
catalyst.pl MyApp

# add models, views, controllers
script/myapp_create.pl model MyDatabase DBIC::Schema create=dynamic dbi:SQLite:/path/to/db
script/myapp_create.pl view MyTemplate TT
script/myapp_create.pl controller Search

# built in testserver -- use -r to restart automatically on changes
# --help to see all available options
script/myapp_server.pl

# command line testing interface
script/myapp_test.pl /yada

### in lib/MyApp.pm
use Catalyst qw/-Debug/; # include plugins here as well

### In lib/MyApp/Controller/Root.pm (autocreated)
sub foo : Global { # called for /foo, /foo/1, /foo/1/2, etc.
my ( $self, $c, @args ) = @_; # args are qw/1 2/ for /foo/1/2
$c->stash->{template} = foo.tt; # set the template
# lookup something from db -- stash vars are passed to TT
$c->stash->{data} =
$c->model(Database::Foo)->search( { country => $args[0] } );
if ( $c->req->params->{bar} ) { # access GET or POST parameters
$c->forward( bar ); # process another action
# do something else after forward returns
}
}

# The foo.tt TT template can use the stash data from the database
[% WHILE (item = data.next) %]
[% item.foo %]
[% END %]

# called for /bar/of/soap, /bar/of/soap/10, etc.
sub bar : Path(/bar/of/soap) { ... }

# called for all actions, from the top-most controller downwards
sub auto : Private {
my ( $self, $c ) = @_;
if ( !$c->user_exists ) { # Catalyst::Plugin::Authentication
$c->res->redirect( /login ); # require login
return 0; # abort request and go immediately to end()
}
return 1; # success; carry on to next action
}

# called after all actions are finished
sub end : Private {
my ( $self, $c ) = @_;
if ( scalar @{ $c->error } ) { ... } # handle errors
return if $c->res->body; # already have a response
$c->forward( MyApp::View::TT ); # render template
}

### in MyApp/Controller/Foo.pm
# called for /foo/bar
sub bar : Local { ... }

# called for /blargle
sub blargle : Global { ... }

# an index action matches /foo, but not /foo/1, etc.
sub index : Private { ... }

### in MyApp/Controller/Foo/Bar.pm
# called for /foo/bar/baz
sub baz : Local { ... }

# first Root auto is called, then Foo auto, then this
sub auto : Private { ... }

# powerful regular expression paths are also possible
sub details : Regex(^product/(w+)/details$) {
my ( $self, $c ) = @_;
# extract the (w+) from the URI
my $product = $c->req->captures->[0];
}

<<less
Download (0.14MB)
Added: 2007-05-09 License: Perl Artistic License Price:
898 downloads
Net::MarkLogic::XDBC 0.11

Net::MarkLogic::XDBC 0.11


Net::MarkLogic::XDBC is a Perl module with XDBC connectivity for MarkLogic CIS servers. more>>
Net::MarkLogic::XDBC is a Perl module with XDBC connectivity for MarkLogic CIS servers.

SYNOPSIS

use Net::MarkLogic::XDBC

$xdbc = Net::MarkLogic::XDBC->new( "user:pass@localhost:9000" );

$xdbc = Net::MarkLogic::XDBC->new(host => $host,
port => $port,
username => $user,
password => $pass, );

$result = $agent->query($xquery);

print $result->content;

@items = $result->items;
print $item->content;

METHODS

new()

$xdbc = Net::MarkLogic::XDBC->new( "user:pass@localhost:9000" );

$xdbc = Net::MarkLogic::XDBC->new( host => $hostname,
port => $port,
username => $user,
password => $pass, );

Connect using a connection string or named host, port, username, and password parameters.

query()

$result = $xdbc->query($xquery);

Execute XQUERY code on XDBC server.

query_from_template()
$result = $xdbc->query_from_template($template, $args);

Generate XQUERY code from a template toolkit template and arguments, then execute on XDBC server.

This might be overkill, but its definitely a feature youre not going to find in the Java API.

<<less
Download (0.009MB)
Added: 2007-06-23 License: Perl Artistic License Price:
853 downloads
Term::Shell 0.01

Term::Shell 0.01


Term::Shell is a simple command-line shell framework. more>>
Term::Shell is a simple command-line shell framework.

SYNOPSIS

package MyShell;
use base qw(Term::Shell);

sub run_command1 { print "command 1!n"; }
sub smry_command1 { "what does command1 do?" }
sub help_command1 {
cmdloop;

Term::Shell lets you write simple command-line shells. All the boring details like command-line parsing, terminal handling, and tab completion are handled for you.
The base class comes with two commands pre-defined: exit and help.

To write a shell with an exec command, do something like this:

package MyShell;
use base qw(Term::Shell); # or manually edit @MyShell::ISA.

sub run_exec {
my ($o, $cmd, @args) = @_;
if ($cmd ne $0) {
print "Im sorry youre leaving us...n";
}
exec $cmd, @args;
exit 1;
}

When Term::Shell needs to handle the exec command, it will invoke this method. Thats all there is to it! You write handlers, and Term::Shell handles the gory details.

<<less
Download (0.017MB)
Added: 2006-11-02 License: Perl Artistic License Price:
1087 downloads
Algorithm::SixDegrees 0.03

Algorithm::SixDegrees 0.03


Algorithm::SixDegrees is a Perl module that can find a path through linked elements in a set. more>>
Algorithm::SixDegrees is a Perl module that can find a path through linked elements in a set.

SYNOPSIS

use Algorithm::SixDegrees;

my $sd1 = Algorithm::SixDegrees->new();
$sd1->data_source( actors => &starred_in );
$sd1->data_source( movies => &stars_of );
@elems = $sd1->make_link(actors, Tom Cruise, Kevin Bacon);

my $sd2 = Algorithm::SixDegrees->new();
$sd2->forward_data_source( friends => &friends, @args );
$sd2->reverse_data_source( friends => &friend_of, @args );
@elems = $sd2->make_link(friends, Bob, Mark);

Algorithm::SixDegrees is a Perl implementation of a breadth-first search through a set of linked elements in order to find the shortest possible chain linking two specific elements together.

In simpler terms, this module will take a bunch of related items and attempt to find a relationship between two of them. It looks for the shortest (and generally, simplest) relationship it can find.

<<less
Download (0.011MB)
Added: 2007-05-17 License: Perl Artistic License Price:
891 downloads
Language::Zcode::Parser 0.8

Language::Zcode::Parser 0.8


Language::Zcode::Parser is a Perl module that reads and parses a Z-code file into a big Perl hash. more>>
Language::Zcode::Parser is a Perl module that reads and parses a Z-code file into a big Perl hash.

SYNOPSIS

# Create a Pure Perl Parser
my $pParser = new Language::Zcode::Parser "Perl";

# If they didnt put ".z5" at the end, find it anyway
$infile = $pParser->find_zfile($infile) || exit;

# Read in the file, store it in memory
$pParser->read_memory($infile);

# Parse header of the Z-file
$pParser->parse_header();

# Get the subroutines in the file (LZ::Parser::Routine objects)
my @subs = $pParser->find_subs($infile);

For finding where the subroutines start and end, you can either depend on an external call to txd, a 1992 C program available at ifarchive.org, or a pure Perl version.

Everything else is done in pure Perl.

new (class, how to find subs, args...)

This is a factory method. Called with Perl or TXD (or txd) as arguments, it will create Parsers of LZ::Parser::Perl or LZ::Parser::TXD, which are subclasses of LZ::Parser::Generic.

That class new method will be called with any other passed-in args.

<<less
Download (0.29MB)
Added: 2007-07-05 License: Perl Artistic License Price:
845 downloads
Sys::AlarmCall 1.2

Sys::AlarmCall 1.2


Sys::AlarmCall is a package to handle the logic in timing out calls with alarm() and an ALRM handler. more>>
Sys::AlarmCall is a package to handle the logic in timing out calls with alarm() and an ALRM handler, allowing nested calls as well.

SYNOPSIS

use Sys::AlarmCall;

$result = alarm_call($timeout1,$func1,@args1);
@result = alarm_call($timeout2,$func2,@args2);

Sys::AlarmCall provides a straightforward function call to use the alarm handler. It also handles the logic which allows nested time out calls if timeout calls are run thorugh the alarm_call() functions.

The main advantages of Sys::AlarmCall are that:

1. simple calls, e.g.

@result = &func(@args); #Normal function call with &
$result = func(@args);; #Normal function call
@result = &$code_reference(@args);
@result = $obj->func(@args); #Object method call

become simple calls:

@result = alarm_call($timeout,&func,@args);
$result = alarm_call($timeout,func,@args);
@result = alarm_call($timeout,$code_reference,@args);
@result = alarm_call($timeout,->func,$obj,@args);

<<less
Download (0.005MB)
Added: 2007-04-13 License: Perl Artistic License Price:
925 downloads
Net::Analysis 0.04

Net::Analysis 0.04


Net::Analysis are modules for analysing network traffic. more>>
Net::Analysis are modules for analysing network traffic.

SYNOPSIS

Using an existing analyser:

$ perl -MNet::Analysis -e main help
$ perl -MNet::Analysis -e main TCP,v=1 dump.tcp - basic TCP info
$ perl -MNet::Analysis -e main HTTP,v=1 dump.tcp - HTTP stuff
$ perl -MNet::Analysis -e main Example2,regex=img dump.tcp - run an example

Writing your own analyser:

package MyExample;
use base qw(Net::Analysis::Listener::Base);
# Listen to events from other modules
sub tcp_monologue {
my ($self, $args) = @_;
my ($mono) = $args->{monologue};
my $t = $mono->t_elapsed()->as_number();
my $l = $mono->length();
# Emit your own event
$self->emit(name => example_event,
args => { kb_sec => ($t) ? $l/($t*1024) : N/A }
);
}
# Process your own event
sub example_event {
my ($self, $args) = @_;
printf "Bandwidth: %10.2f KB/secn", $args->{kb_sec};
}
1;
__top

ABSTRACT

Net::Analysis is a suite of modules that parse tcpdump files, reconstruct TCP sessions from the packets, and provide a very lightweight framework for writing protocol anaylsers.
__top

I wanted a batch version of Ethereal in Perl, so I could:

- sift through parsed protocols with structured filters
- write custom reports that mixed events from multiple protocols

So here it is. Net::Analysis is a stack of protocol handlers that emit, and listen for, events.

<<less
Download (0.30MB)
Added: 2006-07-27 License: Perl Artistic License Price:
1185 downloads
Class::Driver 0.005

Class::Driver 0.005


Class::Driver is a Perl module to generate driver (composite) class hierarchies on-the-fly. more>>


EXAMPLE

# This is a really long synopsis, but hopefully it will give you an idea...

package MyPackage;

use Class::Driver;
use base q(Class::Driver);

our %drivers;

return 1;

sub new {
my($class, %args) = @_;
die "mime_type is required" unless($args{mime_type});
die "no driver to handle type $args{mime_type}"
unless($drivers{$args{mime_type}});
return $class->driver_load($drivers{$args{mime_type}}, %args);
}

sub driver_new {
my($class, %args) = @_;
return bless %args, $class;
}

sub driver_required { 1; }
sub driver_requied_here { 0; }

package MyPackage::avi;

use MyPackage;
use base q(MyPackage);
use Video::Info;

$MyPackage::drivers{video/x-msvideo} = avi;

return 1;

sub driver { "avi"; }

sub driver_new {
my($class, %args) = @_;
die "file is a required parameter for $args{mime_type} files"
unless($args{file});
$args{info} = Video::Info->new(-file => $args{file})
or die "Failed to create a Video::Info object for $args{file}";
return $class->SUPER::driver_new(%args);
}

sub duration {
my $self = shift;
return $args{info}->duration;
}

package MyPackage::mp3;
use base q(MyPackage);
use MP3::Info;

$MyPackage::drivers{audio/mpeg} = mp3;

## (etc...)

package main;

my $foo = MyPackage->new(file => foobar.mp3, mime_type => audio/mpeg);
print "foobar.mp3 is ", $foo->duration, " seconds long.n";

<<less
Download (0.011MB)
Added: 2006-11-14 License: Perl Artistic License Price:
1075 downloads
Proc::Forking 1.38

Proc::Forking 1.38


Proc::Forking is a Perl module that provides a set of tool to fork and daemonize. more>>
Proc::Forking is a Perl module that provides a set of tool to fork and daemonize.

SYNOPSIS

#!/usr/bin/perl

use strict;
use Proc::Forking;
use Data::Dumper;
use Time::HiRes qw(usleep); # to allow micro sleep

my $f = Proc::Forking->new();
$SIG{ KILL } = $SIG{ TERM } = $SIG{ INT } = sub { $f->killall_childs;sleep 1; exit },
$f->daemonize(
## uid => 1000,
## gid => 1000,
## home => "/tmp",
pid_file => "/tmp/master.pid"
);

open( STDOUT, ">>/tmp/master.log" );
my $nbr = 0;
my $timemout;

while ( 1 )
{
if ( $nbr < 20 )
{
my $extra = "other parameter";
my ( $status, $pid, $error ) = $f->fork_child(
function => &func,
name => "new_name.##",
args => [ "hello SOMEONE", 3, $extra ],
pid_file => "/tmp/fork.##.pid",
uid => 1000,
gid => 1000,
home => "/tmp",
max_load => 5,
max_mem => 185000000,
expiration => 10,
# expiration_auto => 1,
);
if ( $status == 4 ) # if the load become to high
{
print "Max load reached, do a little napn";
usleep( 100000 );
next;
}
elsif ( $status ) # if another kind of error

{
print "PID=$pidt error=$errorn";
print Dumper( $f->list_names() );
print Dumper( $f->list_pids() );
}
}
$nbr = $f->pid_nbr;
my ( $n, @dp, @dn ) = $f->expirate;
if ( $n )
{
print Dumper( @dp );
}
print "free=n";
usleep( 100000 ); # always a good idea to put a small sleep to allow task swapper to gain some free resources
}

sub func
{
my $ref = shift;
my @args = @$ref;
my ( $data, $time_out, $sockC ) = @args;
$SIG{ USR1 } = sub { open my $log, ">>/tmp/log.s"; print $log "signal USR1 receivedn"; close $log; };
if ( !$time_out )
{
$time_out = 3;
}
open my $FF, ">>/tmp/loglist";
print $FF $$, " start time =", $^T;
close $FF;

for ( 1 .. 4 )
{
open my $fh, ">>/tmp/log";
if ( defined $fh )
{
print $fh "TMOUT = $time_out " . time . " PID=$$ cwd=" . Cwd::cwd() . " name =$0n";
$fh->close;
}
sleep $time_out + rand( 5 );
}
}

<<less
Download (0.011MB)
Added: 2007-03-06 License: Perl Artistic License Price:
962 downloads
CAD::Drawing::GUI::View 0.01_01

CAD::Drawing::GUI::View 0.01_01


CAD::Drawing::GUI::View are 2D graphics for CAD built on Tk::Zinc. more>>
CAD::Drawing::GUI::View are 2D graphics for CAD built on Tk::Zinc.

This module provides methods to turn a CAD::Drawing object into a Zinc canvas.

Overridden Methods

These make me behave like a Tk widget.

ClassInit

$view->ClassInit();

InitObject

$view->InitObject();

configure

$view->configure(%args);

args_filter

Filters configure arguments and adds non-tk args to our private data.

%args = $view->args_filter(%args);

<<less
Download (0.011MB)
Added: 2006-10-25 License: Perl Artistic License Price:
1094 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5