Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

[ANN] j2Perl 2.0 - Allowing Java to access Perl code

Thread view: 
VMDD Tech - powered by sockSvr - 03 Mar 2005 04:03 GMT
Source: http://vmdd.tech.mylinuxisp.com/catalog/
(Follow "Java Add-ons" link)

j2Perl 2.0 -- provides the ability to use Perl code in Java. This
implementation is elegant and intuitive. Java is already powerful, but
when combined with Perl, Java becomes turbo-charged.

Usage:
    String ret;
    j2Perl pl = new j2Perl ("58");    //Load j2perl58.dll which was linked to
perl58.dll

    ret = pl.eval ("mkdir 'h:/aa'");
    ret = pl.eval ("mkdir 'h:/aa'; mkdir 'h:/bb';");
    ret = pl.eval ("rmdir 'h:/aa'");
    ret = pl.eval ("rename 'h:/aa', 'h:/bb'");
    ret = pl.eval ("-e 'j2perl.h'");    //Test if the file exists
    ret = pl.eval ("-s 't:/a.txt'");    //Returns the file size in bytes
    ret = pl.eval ("-z 'j2perl.h'");    //Test if the file is empty
    ret = pl.eval ("-f 'j2perl.h'");    //Test if the file is a plain file
    ret = pl.eval ("-d 'j2perl.h'");    //Test if the file is a directory
    ret = pl.eval ("-T 't:/a.txt'");    //Test if the file is a text file
    ret = pl.eval ("-B 't:/a.txt'");    //Test if the file is a binary file
    ret = pl.eval ("-M 'h:/jdk-1_5_0-doc.zip'");    //Return age of the file
(days)
    ret = pl.eval ("-A 'h:/jdk-1_5_0-doc.zip'");    //Same for access time
(days)
    ret = pl.eval ("-M 'h:/jdk-1_5_0-doc.zip'");    //Same for inode change
(days)
    ret = pl.eval ("sprintf ('%5d', 12);");    //ret = "   12"
    ret = pl.eval ("sprintf ('%5.5d', 12);");    //ret = "00012"
    ret = pl.eval ("sprintf ('this prints 2 decimals: %5.2f',
1.23456)");    //ret = "this prints 2 decimals:  1.23";
    ret = pl.eval ("time;")    //Returns the number of non-leap seconds since
whatever time the system considers epoch

    ret = pl.source ("a.pl");    //Execute a.pl
    ret = pl.eval ("unlink 't:/a.txt'");    //Delete the specified file
    ret = pl.eval ("unlink ");    //Delete group of files; Return number of
files deleted
    ret = pl.eval ("$_='this will be translated'; tr/tw/TW/; $_");    //ret =
"This Will be TranslaTed";
    ret = pl.eval ("gmtime (time)");    //ret = "Wed Mar  2 22:08:34 2005"
    ret = pl.eval ("localtime (time)");    //ret = "Wed Mar  2 16:12:28 2005"
    ret = pl.eval ("hex '0x12'")    //Convert hex to decimal; ret = "18";

    ret = pl.eval ("@arr = (tien, cam, banh)");
    ret = pl.eval ("@result = sort @arr");    //ret = "3";
    ret = pl.eval ("join (' ', @res)");    //ret = "banh cam tien";

BE AWARE:
    If perl code has exception, then Java program will exit.  Thus, make
sure that your perl
    code is extremely robust.

TRIAL:
    Before downloading j2Perl, please note that j2Perl is free for
personal use. But, businesses,
    government agencies, and commercial use require licensing.  Download
    now.
Philip Salgannik - 04 Mar 2005 05:07 GMT
What does this have to do with this newsgroup?

Signature

__

> Source: http://vmdd.tech.mylinuxisp.com/catalog/
> (Follow "Java Add-ons" link)
[quoted text clipped - 56 lines]
> government agencies, and commercial use require licensing.  Download
> now.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.