Main > Free Download Search >

Free eval software for linux

eval

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 124
Libeval 1.0.7

Libeval 1.0.7


Libeval provides simple means of evaluating simple arithmetic expressions. more>>
Libeval provides simple means of evaluating simple arithmetic expressions involving literal numeric values, variables and functions using the addition (+), subtraction (-), multiplication (*), division (/), modulo division (), exponentiation (^), sign (+-), percentag (%) and grouping (()) operators.
Libeval provides a means of setting and interrogating variables, defining functions and converting error codes into human readable strings. A number of predefined functions are included with libeval that wrap the existing standard C library math functions.
You can evaluate an expression by calling the eval() function. eval() takes two parameters, the expression to evaluate (as a simple C string) and a reference to a double precision float in which to put the result. If eval() encounters an error it returns a non-zero value, otherwise, if everything went well, it returns zero.
The error code returned by eval() can be converted into a human readable string by the eval_error() function. eval_error() takes one parameter, the error code returned by eval(),and returns a constant string describing the error.
Variables can be manipulated with the eval_set_var() and eval_get_var() functions.
eval_set_var() sets the named variable to the specified double precision value. eval_set_var() takes two parameters, the name of the variable to set as a simple C string, and the double precision float value to set the variable to. it returns 0 (zero) on success, non-zero on failure.
eval_get_var() gets the value of the named variable. eval_get_var() takes two parameters, the name of the variable as a simple C string and a reference to a double precision float in which to store the variables value. it returns 0 (zero) on success, non-zero on failure.
Functions can be defined with the eval_def_fn() function, which takes the name of the function as a simple C string, a pointer to a C function implementing the function, a pointer to a block of custom storage for use by the function and the number of arguments taken by the function. The prototype for the implementation function is:
int fn(int args, double *arg, double *rv, void *data);
The first two parameters (args and arg) are similar to the standard parameters to the main() function in C, the args parameter indicates how many elements are the argument list, and arg is the argument list itself. The third parameter (rv) is the return value from the function. The last parameter (data) is the custome storage block passed in when the function was defined.
If you specify a positive value (including zero) as the number of arguments for a function, libeval will only all the function to be called with exactly that number of parameters. If you specify a -1 (negative one) for the number of arguments, the function can be called with any number of parameters.
The following functions are predefined:
abs(x) absolute value of x
int(x) integer part of x
round(x) round x to nearest integer
trunc(x) truncate x (same as int(x))
floor(x) round x to nearest lesser integer
ceil(x) round x to nearest greater integer
sin(x) sine of x (radians)
cos(x) cosine of x (radians)
tan(x) tangent of x (radians)
asin(x) arc sine of x (radians)
acos(x) arc cosine of x (radians)
atan(x) arc tangent of x (radians)
sinh(x) hyperbolic sine of x (radians)
cosh(x) hyperbolic cosine of x (radians)
tanh(x) hyperbolic tangent of x (radians)
asinh(x) hyperbolic arc sine of x (radians)
acosh(x) hyperbolic arc cosine of x (radians)
atanh(x) hyperbolic arc tangent of x (radians)
deg(x) convert radians to degrees
rad(x) convert degrees to radians
ln(x) natural logarithm of x
log(x) base 10 logarithm of x
sqrt(x) square root of x
exp(x) e to x power
rand() random number between 0.0 and 1.0
fact(x) factorial of x (or gamma(x) if x is non-integer)
sum(...) sum of the arguments
min(...) minimum value in arguments
max(...) maximum value in arguments
avg(...) average of arguments
med(...) median of arguments
var(...) variance of arguments
std(...) standard deviation of arguments
Finally, you can get a set of bookkeepping information about the eval_expr libray with the eval_info() function. eval_info() takes nine parmaeters: three references to integer values for the version, revision and build numbers of the current eval_expr library, and three pairs of buffer address and buffer size limit for authors name, copyright info and license info.
You can use libeval by including the libeval header in your program source
#include
and then by linking your program against the libeval library
gcc -o myprog myprog.c -leval
Enhancements:
- A bug in the var() function and version string construction were fixed.
<<less
Download (0.027MB)
Added: 2007-01-17 License: LGPL (GNU Lesser General Public License) Price:
1011 downloads
poker-eval 134.0

poker-eval 134.0


poker-eval is a C library to evaluate poker hands. more>>
poker-eval is a C library that can evaluate poker hands. The result of the evalution for a given hand is a number. The general idea is that if the evalution of your hand is lower than the evaluation of the hand of your opponent, you lose.
Many poker variants are supported (draw, holdem, omaha, etc.) and more can be added. poker-eval is designed for speed so that it can be used within poker simulation software using either exhaustive exploration or Monte Carlo.
Installation:
This library uses the GNU Autoconf self-configuration mechanism, so compiling on a GNU/Linux and Unix system should be fairly simple.
To build both the C library and the examples:
./configure
( cd lib && make build_tables )
make
To build and run the tests:
./configure
( cd lib && make build_tables )
make check
The "make check" command will run several test programs to ensure that everything works correctly. On slow machines, the tests may take several minutes.
To install the library and the headers (by default they will install in /usr/local/lib and /usr/local/include/poker-eval respectively):
./configure
make install
To run the examples:
cd examples
read the usage at the beginning of the source file
and run the program accordingly
Enhancements:
- Bugfixes.
<<less
Download (0.45MB)
Added: 2007-05-21 License: GPL (GNU General Public License) Price:
892 downloads
Language::Frink::Eval 0.02

Language::Frink::Eval 0.02


Language::Frink::Eval is a Perl module that acts as a simple wrapper around the Frink interpreter written by Alan Eliasen. more>>
Language::Frink::Eval is a Perl module that acts as a simple wrapper around the Frink interpreter written by Alan Eliasen. As such, it requires a local copy of the Java interpreter and the frink.jar file. For more information on Frink, please see http://futureboy.homeip.net/frinkdocs/.

This module works by starting a JVM as a child process, and sending Frink expressions to it via a pipe, and retrieving the results the same way. Also, this module has the ability to function in a restricted mode it attempts to filter "dangerous" expressions, such as functions that read files from local disk, the network, and also commands that may persistantly change the interpreter state.

The list of "dangerous" functions and expressions was derived by reading the Frink documentation, and probably is not complete. If you find commands that get through the filter that should, please report them.

The following functions are not allowed in restricted mode:

lines[]
read[]
eval[]
input[]
select[]
callJava[]
newJava[]
staticJava[]

The following language constructs are not allowed in restricted mode:

Regexes
Function Declarations
Unit display format
Loops
Time display format
Procedure blocks
File inclusion
Class Declaration

<<less
Download (0.22MB)
Added: 2007-06-07 License: Perl Artistic License Price:
869 downloads
Class::Observable 1.04

Class::Observable 1.04


Class::Observable is a Perl module that allows other classes and objects to respond to events in yours. more>>
Class::Observable is a Perl module that allows other classes and objects to respond to events in yours.

SYNOPSIS

# Define an observable class

package My::Object;

use base qw( Class::Observable );

# Tell all classes/objects observing this object that a state-change
# has occurred

sub create {
my ( $self ) = @_;
eval { $self->_perform_create() };
if ( $@ ) {
My::Exception->throw( "Error saving: $@" );
}
$self->notify_observers();
}

# Same thing, except make the type of change explicit and pass
# arguments.

sub edit {
my ( $self ) = @_;
my %old_values = $self->extract_values;
eval { $self->_perform_edit() };
if ( $@ ) {
My::Exception->throw( "Error saving: $@" );
}
$self->notify_observers( edit, old_values => %old_values );
}

# Define an observer

package My::Observer;

sub update {
my ( $class, $object, $action ) = @_;
unless ( $action ) {
warn "Cannot operation on [", $object->id, "] without action";
return;
}
$class->_on_save( $object ) if ( $action eq save );
$class->_on_update( $object ) if ( $action eq update );
}

# Register the observer class with all instances of the observable
# class

My::Object->add_observer( My::Observer );

# Register the observer class with a single instance of the
# observable class

my $object = My::Object->new( foo );
$object->add_observer( My::Observer );

# Register an observer object the same way

my $observer = My::Observer->new( bar );
My::Object->add_observer( $observer );
my $object = My::Object->new( foo );
$object->add_observer( $observer );

# Register an observer using a subroutine

sub catch_observation { ... }

My::Object->add_observer( &catch_observation );
my $object = My::Object->new( foo );
$object->add_observer( &catch_observation );

# Define the observable class as a parent and allow the observers to
# be used by the child

package My::Parent;

use strict;
use base qw( Class::Observable );

sub prepare_for_bed {
my ( $self ) = @_;
$self->notify_observers( prepare_for_bed );
}

sub brush_teeth {
my ( $self ) = @_;
$self->_brush_teeth( time => 45 );
$self->_floss_teeth( time => 30 );
$self->_gargle( time => 30 );
}

sub wash_face { ... }


package My::Child;

use strict;
use base qw( My::Parent );

sub brush_teeth {
my ( $self ) = @_;
$self->_wet_toothbrush();
}

sub wash_face { return }

# Create a class-based observer

package My::ParentRules;

sub update {
my ( $item, $action ) = @_;
if ( $action eq prepare_for_bed ) {
$item->brush_teeth;
$item->wash_face;
}
}

My::Parent->add_observer( __PACKAGE__ );

$parent->prepare_for_bed # brush, floss, gargle, and wash face
$child->prepare_for_bed # pretend to brush, pretend to wash face

<<less
Download (0.010MB)
Added: 2007-06-06 License: Perl Artistic License Price:
870 downloads
XML::XMetaL 0.52

XML::XMetaL 0.52


XML::XMetaL is a Perl module with dispatch class for XML::XMetaL development framework. more>>
XML::XMetaL is a Perl module with dispatch class for XML::XMetaL development framework.

The XML::XMetaL class is a dispatcher for XMetaL customization handlers. XML:XMetaL objects are singletons. There can be only one XML::XMetaL object instantiated at any one time.

If an XML::XMetaL object already exists, the constructor (new) will just return the already existing object.

Customization handlers are registered and associated with a system identifier with the add_handler method.

When a method is called on a dispatcher (XML::XMetaL object), the dispatcher figures out which handler that should handle the call, and forwards the method call to the handler.

For example, calling On_Document_Save on the dispatcher, will make the dispatcher call the On_Document_Save method for the handler associated with the system identifier of the currently active document.

When the dispatcher calls a handler, the call is wrapped in an eval block. If an exception is thrown by the handler, it will be caught by the dispatcher and the error message will be shown in an XMetaL Alert box.

<<less
Download (0.024MB)
Added: 2006-09-21 License: Perl Artistic License Price:
1131 downloads
PLJava 0.04

PLJava 0.04


PLJava is Perl module that will embed Perl into Java. more>>
PLJava is Perl module that will embed Perl into Java.

USAGE

import perl5.Perl ;
import perl5.SV ;

public class test {

public static void main(String argv[]) {

Perl.eval("print qq`Hello World!n` ;") ;

///////////////////

SV foo = Perl.NEW("foo") ; // $foo = new foo() ;

foo.call("subtest") ; // $foo->subtest() ;

///////////////////

String s = Perl.eval(" time: + time() ") ;

int i = Perl.eval_int(" 2**10 ") ; // 1024

int n = Perl.eval_int(" 10/3 ") ; // 3
int d = Perl.eval_double(" 10/3 ") ; // 3.33333333333333

///////////////////

SV array = Perl.eval_sv(" [ a , b , c ] ") ;

String e0 = array.elem(0) ; // a
String e1 = array.elem(1) ; // b
String e2 = array.elem(2) ; // c

///////////////////

SV hash = Perl.eval_sv(" { a => 11 , b => 22 , c => 33 } ") ;

String k_a = hash.key("a") ; // 11
String k_b = hash.key("b") ; // 22
String k_c = hash.key("c") ; // 33

}

}

<<less
Download (0.16MB)
Added: 2007-06-06 License: Perl Artistic License Price:
872 downloads
dicelab 0.4

dicelab 0.4


dicelab allows you to express complex dice rolling schemes in a functional language and then roll dice. more>>
dicelab allows you to express complex dice rolling schemes in a functional language and then roll dice according to such a scheme or analyze the statistic distribution of values.
It is useful when designing games (and to some degree when playing them).
Usage: dicelab [options] [-f < file >]
Options:
--help -h -? print this text
--version -v print the program version
--print-tree -p print the parse tree (for debugging)
--eval -e evaluate the statistical distribution by
re-rollingp
--count -c specify the number of rolls used with --eval
default is 10000
--roll -r roll the dice as specified, will also be used
if no other action is requested
File:
--file -f read the dice rolling specs from the file
specified, use stdin if not supplied
Enhancements:
- The program is much faster now.
<<less
Download (0.13MB)
Added: 2007-08-21 License: GPL (GNU General Public License) Price:
794 downloads
wdshell 0.98

wdshell 0.98


wdshell is a tool that runs shell commands using RubyWebDialogs. more>>
rwdshell uses the RubyWebDialogs GUI to run shell commands in a Web browser. It uses the rwdtinker framework for removal and installation of applets.

You have a Ruby eval screen, a shell command line, and a shell script runner. You can edit scripts and run Ruby scripts.
<<less
Download (0.11MB)
Added: 2005-04-27 License: GPL (GNU General Public License) Price:
1640 downloads
Pequel 2.4-6

Pequel 2.4-6


Pequel provides a tool to create complex and efficient ETL processes. more>>
Pequel provides a tool to create complex and efficient ETL processes.
Pequel is a comprehensive ETL system. It features a simple, user-friendly event driven scripting interface that transparently generates and executes highly efficient low level multi-db API code (Oracle-OCI, Sqlite).
Enhancements:
- New Pequel Quick Reference Guide (docs/pequelquickref.pdf).
- Fixed module name in ETL::Pequel::Pod2Pdf, scripts/pequelpod2pdf.
- Option: exec_min_lines -use this to specify max program code size that will execute with eval() otherwise execute with exec() on external tmp EXEC program file. Defaults to 200 lines. The exec() execution will substantially improve the performance when copy/divert sections are in use.
- Fixed user defined date type parse problem.
- Some vim-syntax updates.
<<less
Download (0.71MB)
Added: 2007-01-31 License: GPL (GNU General Public License) Price:
997 downloads
Acme::JavaTrace 0.06

Acme::JavaTrace 0.06


Acme::JavaTrace is a Perl module for using Java-like stack traces. more>>
Acme::JavaTrace is a Perl module for using Java-like stack traces.

SYNOPSIS

On the command-line:

perl -wMAcme::JavaTrace program_with_strange_errors.pl

Inside a module:

use Acme::JavaTrace;
warn "some kind of non-fatal exception occured";
die "some kind of fatal exception occured";

< buzzword >This module tries to improves the Perl programmer experience by porting the Java paradigm to print stack traces, which is more professional than Perls way. < /buzzword >

This is achieved by modifying the functions warn() and die() in order to replace the standard messages by complete stack traces that precisely indicates how and where the error or warning occurred. Other than this, their use should stay unchanged, even when using die() inside eval().

<<less
Download (0.015MB)
Added: 2007-06-07 License: Perl Artistic License Price:
869 downloads
Oraperl 1.19

Oraperl 1.19


Oraperl is a Perl access to Oracle databases for old oraperl scripts. more>>
Oraperl is a Perl access to Oracle databases for old oraperl scripts.

SYNOPSIS

eval use Oraperl; 1; || die $@ if $] >= 5; # ADD THIS LINE TO OLD SCRIPTS

$lda = ⊦a_login($system_id, $name, $password)
$csr = ⊦a_open($lda, $stmt [, $cache])
⊦a_bind($csr, $var, ...)
⊦a_fetch($csr [, $trunc])
⊦a_close($csr)
⊦a_logoff($lda)

⊦a_do($lda, $stmt)

⊦a_titles($csr)
⊦a_lengths($csr)
⊦a_types($csr)
⊦a_commit($lda)
⊦a_rollback($lda)
⊦a_autocommit($lda, $on_off)
⊦a_version()

$ora_cache
$ora_long
$ora_trunc
$ora_errno
$ora_errstr
$ora_verno

$ora_debug

Oraperl is an extension to Perl which allows access to Oracle databases.
The original oraperl was a Perl 4 binary with Oracle OCI compiled into it. The Perl 5 Oraperl module described here is distributed with DBD::Oracle (a database driver what operates within DBI) and adds an extra layer over DBI method calls. The Oraperl module should only be used to allow existing Perl 4 oraperl scripts to run with minimal changes; any new development should use DBI directly.

The functions which make up this extension are described in the following sections. All functions return a false or undefined (in the Perl sense) value to indicate failure. You do not need to understand the references to OCI in these descriptions. They are here to help those who wish to extend the routines or to port them to new machines.

The text in this document is largely unchanged from the original Perl4 oraperl manual written by Kevin Stock. Any comments specific to the DBD::Oracle Oraperl emulation are prefixed by DBD:. See the DBD::Oracle and DBI manuals for more information.

DBD: In order to make the oraperl function definitions available in perl5 you need to arrange to use the Oraperl.pm module in each file or package which uses them. You can do this by simply adding use Oraperl; in each file or package. If you need to make the scripts work with both the perl4 oraperl and perl5 you should add add the following text instead:
eval use Oraperl; 1; || die $@ if $] >= 5;

<<less
Download (0.36MB)
Added: 2007-05-15 License: Perl Artistic License Price:
895 downloads
GradeL 0.8.2

GradeL 0.8.2


GradeL (Gradebook for Linux) is a gradebook program for teachers. more>>
GradeL (Gradebook for Linux) is a gradebook program for teachers. Written in Gambas, this program includes some features I felt were important in a gradebook program. While still buggy and incomplete, it is functional.

GradeL requires the development version of Gambas, currently version 1.9.26. GradeL uses Gambas components gb.eval, gb.qt, gb.qt.ext, gb.qt.kde, and gb.qt.kde.html.

Although my coding technique is at times inefficient, GradeL does meet my needs. It features a spreadsheet-style main screen with vertical column headers that include the assignment name, category, and points. Assignments are grouped in categories for reporting purposes. Teachers may enter numerical scores or alpha-numeric codes for student scores.

These codes may count either zero points or excuse the student from that particular assignment. Gambas Grade provides practical reports designed to give plenty of information while conserving paper. Current reports include complete class report, single marking period progress report, and progress reports for all students. One other feature that I really like is an average row included in the spreadsheet that displays the average for the class on every assignment and for the overall marking period grade.

GradeL project is still in its infancy. The program still has bugs and incomplete features. I am making it available now as a preview for review and testing purposes. You may not want to use it as your primary grading program at this time.

<<less
Download (0.50MB)
Added: 2007-07-12 License: GPL (GNU General Public License) Price:
836 downloads
Religion 1.04

Religion 1.04


Religion is a Perl module that can generate tracebacks and create and install die() and warn() handlers. more>>
Religion is a Perl module that can generate tracebacks and create and install die() and warn() handlers.

This is a second go at a module to simplify installing die() and warn() handlers, and to make such handlers easier to write and control.

For most people, this just means that if use use Religion; then youll get noticably better error reporting from warn() and die(). This is especially useful if you are using eval().

Religion provides four classes, WarnHandler, DieHandler, WarnPreHandler, and DiePreHandler, that when you construct them return closures that can be stored in variables that in turn get invoked by $SIG{__DIE__} and $SIG{__WARN__}. Note that if Religion is in use, you should not modify $SIG{__DIE__} or $SIG{__WARN__}, unless you are careful about invoking chaining to the old handler.

Religion also provides a TraceBack function, which is used by a DieHandler after you die() to give a better handle on the current scope of your situation, and provide information about where you were, which might influence where you want to go next, either returning back to where you were, or going on to the very last. [Sorry - Ed.]

See below for usage and examples.

USAGE

DieHandler SUB

Invoke like this:

$Die::Handler = new DieHandler sub {
#...
};

where #... contains your handler code. Your handler will receive the following arguments:

$message, $full_message, $level, $eval,
$iline, $ifile, $oline, $ofile, $oscope

$message is the message provided to die(). Note that the default addition of " at FILE line LINE.n" will have been stripped off if it was present. If you want to add such a message back on, feel free to do so with $iline and $ifile.

$full_message) is the message with a scope message added on if there was no newline at the end of $message. Currently, this is not the original message that die() tacked on, but something along the lines of " at line 3 of the eval at line 4 of Foo.pln".

$eval is non-zero if the die() was invoked inside an eval.

The rest of the arguments are explained in the source for Religion::TraceBack. Yes, I need to document these, but not just now, for they are a pain to explain.
Whenever you install a DieHandler, it will automatically store the current value of $Die::Handler so it can chain to it. If you want to install a handler only temporarily, use local().

If your handler returns data using return or by falling off the end, then the items returns will be used to fill back in the argument list, and the next handler in the chain, if any, will be invoked. Dont fall off the end if you dont want to change the error message.

If your handler exits using last, then no further handlers will be invoked, and the program will die immediatly.

If your handler exits using next, then the next handler in the chain will be invoked directly, without giving you a chance to change its arguments as you could if you used return.

If your handler invokes die(), then die() will proceed as if no handlers were installed. If you are inside an eval, then it will exit to the scope enclosing the eval, otherwise it will exit the program.

WarnHandler SUB

Invoke like this:

$Warn::Handler = new WarnHandler sub {
#...
};

For the rest of its explanation, see DieHandler, and subsitute warn() for die(). Note that once the last DieHandler completes (or last is invoked) then execution will return to the code that invoked warn().

DiePreHandler SUB

Invoke like this:

$Die::PreHandler = new DiePreHandler sub {
#...
};

This works identically to $Die::Handler, except that it forms a separate chain that is invoked before the DieHandler chain. Since you can use last to abort all the handlers and die immediately, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages from further handling.

This is even more useful in $Warn::PreHandler, since you can just throw away warnings that you know arent needed.

WarnPreHandler SUB

Invoke like this:

$Warn::PreHandler = new WarnPreHandler sub {
#...
};

This works identically to $Warn::Handler, except that it forms a separate chain that is invoked before the WarnHandler chain. Since you can use last to abort all the handlers and return to the program, or change the messages or scope details, this can be useful for modifying data that all future handlers will see, or to dispose of some messages.

This is very useful, since you can just throw away warnings that you know arent needed.

<<less
Download (0.005MB)
Added: 2007-05-24 License: Perl Artistic License Price:
883 downloads
Persistent::Oracle 0.50

Persistent::Oracle 0.50


Persistent::Oracle is a persistent class implemented using an Oracle database. more>>
Persistent::Oracle is a persistent class implemented using an Oracle database.

SYNOPSIS

use Persistent::Oracle;
use English; # import readable variable names like $EVAL_ERROR

eval { ### in case an exception is thrown ###

### allocate a persistent object ###
my $emp = new Persistent::Oracle(dbi:Oracle:ORCL,
scott, tiger, emp);

### define attributes of the object ###
$emp->add_attribute(empno, ID, Number, undef, 4);
$emp->add_attribute(ename, Persistent, VarChar, undef, 10);
$emp->add_attribute(job, Persistent, VarChar, undef, 9);
$emp->add_attribute(mgr, Persistent, Number, undef, 4);
$emp->add_attribute(hiredate, Persistent, DateTime, undef);
$emp->add_attribute(sal, Persistent, Number, undef, 7, 2);
$emp->add_attribute(comm, Persistent, Number, undef, 7, 2);
$emp->add_attribute(deptno, Persistent, Number, undef, 2);

### query the datastore for some objects ###
$emp->restore_where(qq{
sal > 1000 and
job = CLERK and
ename LIKE M%
}, "sal, ename");
while ($emp->restore_next()) {
printf "ename = %s, emp# = %s, sal = %s, hiredate = %sn",
$emp->ename, $emp->empno, $emp->sal, $emp->hiredate;
}
};

if ($EVAL_ERROR) { ### catch those exceptions! ###
print "An error occurred: $EVAL_ERRORn";
}

ABSTRACT

This is a Persistent class that uses an Oracle database table to store and retrieve objects. This class can be instantiated directly or subclassed. The methods described below are unique to this class, and all other methods that are provided by this class are documented in the Persistent documentation. The Persistent documentation has a very thorough introduction to using the Persistent framework of classes.

<<less
Download (0.011MB)
Added: 2007-05-19 License: Perl Artistic License Price:
889 downloads
Inline::Java::PerlInterpreter 0.52

Inline::Java::PerlInterpreter 0.52


Inline::Java::PerlInterpreter is a Perl module used to call Perl directly from Java using Inline::Java. more>>
Inline::Java::PerlInterpreter is a Perl module used to call Perl directly from Java using Inline::Java.

SYNOPSIS

import org.perl.inline.java.* ;

class HelpMePerl {
static private InlineJavaPerlInterpreter pi = null ;

public HelpMePerl() throws InlineJavaException {
}

static private boolean matches(String target, String pattern)
throws InlineJavaPerlException, InlineJavaException {
Boolean b = (Boolean)pi.eval("" + target + " =~ /" + pattern + "/", Boolean.class) ;
return b.booleanValue() ;
}

public static void main(String args[])
throws InlineJavaPerlException, InlineJavaException {
pi = InlineJavaPerlInterpreter.create() ;

String target = "aaabbbccc" ;
String pattern = "ab+" ;
boolean ret = matches(target, pattern) ;

System.out.println(
target + (ret ? " matches " : " doesnt match ") + pattern) ;

pi.destroy() ;
}
}

WARNING: Inline::Java::PerlInterpreter is still experimental.
The org.perl.inline.java.InlineJavaPerlInterpreter Java class allows you to load a Perl interpreter directly from Java. You can then perform regular callbacks to call into Perl.

<<less
Download (0.092MB)
Added: 2007-06-02 License: Perl Artistic License Price:
877 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5