[21801] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4005 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 21 09:11:19 2002

Date: Mon, 21 Oct 2002 06:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 21 Oct 2002     Volume: 10 Number: 4005

Today's topics:
        perl CGI call java class problem <liang@expert.ics.purdue.edu>
    Re: perl CGI call java class problem <tassilo.parseval@post.rwth-aachen.de>
    Re: perl CGI call java class problem <liang@expert.ics.purdue.edu>
    Re: perl CGI call java class problem <tassilo.parseval@post.rwth-aachen.de>
        prototype mismatch in autogenerated module (XS) <tassilo.parseval@post.rwth-aachen.de>
        Replace warn and die <postmaster@localhost.localdomain>
    Re: Replace warn and die <tassilo.parseval@post.rwth-aachen.de>
    Re: Replace warn and die <postmaster@localhost.localdomain>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        Stopping IIS website <t18_pilot@hotmail.spam.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 21 Oct 2002 03:15:36 -0500
From: Hong Liang <liang@expert.ics.purdue.edu>
Subject: perl CGI call java class problem
Message-Id: <Pine.GSO.4.44.0210210315030.2241-100000@expert.ics.purdue.edu>

Hi, all,
  I am writing a CGI with perl, in which, the CGI need to
call a java class (not an applet) to do some calculation
then save the results into a file, then my perl CGI opens
it to do further processing.
  No matter what I try, the CGI just can't see the java class
in the same directory. One of the things I tried was:
  system("java ss.class");

  I've been searching for the solution on the web, not very
fruitful.

  Could anybody help??!!!
  Thanks,
  Hong.





------------------------------

Date: 21 Oct 2002 08:24:27 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: perl CGI call java class problem
Message-Id: <ap0djr$dhk$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Hong Liang:

>   I am writing a CGI with perl, in which, the CGI need to
> call a java class (not an applet) to do some calculation
> then save the results into a file, then my perl CGI opens
> it to do further processing.

Did you try to run it from the command-line? Did it work? I guess not.

>   No matter what I try, the CGI just can't see the java class
> in the same directory. One of the things I tried was:
>   system("java ss.class");

Your question rather is about how to run a java program and therefore a
little off-topic here. Hint: you invoke compiled Java classes without
the .class extenstion. Therefore try:

    system "java", "ss";

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


------------------------------

Date: Mon, 21 Oct 2002 03:49:58 -0500
From: Hong Liang <liang@expert.ics.purdue.edu>
To: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: perl CGI call java class problem
Message-Id: <Pine.GSO.4.44.0210210348380.8407-100000@expert.ics.purdue.edu>

HI,
 Right, right, I 've tried running it from command line, everything
worked.
  right, I used system("java ss"); again it worked from command line.
  more help, please???


On 21 Oct 2002, Tassilo v. Parseval wrote:

> Also sprach Hong Liang:
>
> >   I am writing a CGI with perl, in which, the CGI need to
> > call a java class (not an applet) to do some calculation
> > then save the results into a file, then my perl CGI opens
> > it to do further processing.
>
> Did you try to run it from the command-line? Did it work? I guess not.
>
> >   No matter what I try, the CGI just can't see the java class
> > in the same directory. One of the things I tried was:
> >   system("java ss.class");
>
> Your question rather is about how to run a java program and therefore a
> little off-topic here. Hint: you invoke compiled Java classes without
> the .class extenstion. Therefore try:
>
>     system "java", "ss";
>
> Tassilo
> --
> $_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
> pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
> $_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
>



------------------------------

Date: 21 Oct 2002 09:03:26 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: perl CGI call java class problem
Message-Id: <ap0fsu$fsk$1@nets3.rz.RWTH-Aachen.DE>

[ please don't send stealth CCs;
  also don't top-post;
  always trim your replies to the bare minimum of what is needed;
  posting re-arranged ]

Also sprach Hong Liang:

> On 21 Oct 2002, Tassilo v. Parseval wrote:
> 
>> Also sprach Hong Liang:

>> >   No matter what I try, the CGI just can't see the java class
>> > in the same directory. One of the things I tried was:
>> >   system("java ss.class");
>>
>> Your question rather is about how to run a java program and therefore a
>> little off-topic here. Hint: you invoke compiled Java classes without
>> the .class extenstion. Therefore try:
>>
>>     system "java", "ss";

>  Right, right, I 've tried running it from command line, everything
> worked.
>   right, I used system("java ss"); again it worked from command line.
>   more help, please???

Have you read 'perldoc -q 500'?  Since your script works in a non-CGI
environment, you don't actually have a Perl-problem. The FAQ-entries
mentions some points where your problem is better dealt with.

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


------------------------------

Date: 21 Oct 2002 08:21:13 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: prototype mismatch in autogenerated module (XS)
Message-Id: <ap0ddp$d8u$1@nets3.rz.RWTH-Aachen.DE>

Hi,

suppose I have created a module's stub with

    h2xs -O -n Module::Name header.h

Then I'll have a Name.pm file that supplies an AUTOLOAD()er for the #defines
in header.h. I gathered these constants in the ':constants' export-tag.
Yet, when I try the following in a test-script for the module:

    use Module::Name qw(:constants);
    print MN_EERROR;
    __END__
    Prototype mismatch: sub Module::Name::MN_EERROR vs () at
    ../blib/lib/Module/Name.pm line 84.
    1

The corresponding code in the autogenerated .pm file:
    
    ...
    {
	no strict 'refs';
	# Fixed between 5.005_53 and 5.005_61
	if ($] >= 5.00561) {
	    *$AUTOLOAD = sub () { $val };  # <---- line 84
	}
	else {
	    *$AUTOLOAD = sub { $val };
	}
    }
    goto &$AUTOLOAD;
    
Is this a compile time versus run time thing? It works fine when
removing the prototype. But then, why this case distinction for $] 
above? Right now, I am quite inclined to throw it out.

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


------------------------------

Date: Mon, 21 Oct 2002 11:36:17 +0100
From: "bengee" <postmaster@localhost.localdomain>
Subject: Replace warn and die
Message-Id: <ap0la1$vgb$1@news0.ifb.net>

How do i use my own versions of the warn and die functions? Is this
what is know as function overloading?

TIA

bengee




------------------------------

Date: 21 Oct 2002 11:01:30 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Replace warn and die
Message-Id: <ap0mqa$mq4$1@nets3.rz.RWTH-Aachen.DE>

Also sprach bengee:

> How do i use my own versions of the warn and die functions? Is this
> what is know as function overloading?

No, not quite. Functionally it comes close to it, though. You do that by
setting a handler for two special signals.

    $SIG{__DIE__} = sub {
        my $die_msg = shift;
        print "I died:\n", $msg, "\n";
    };

    $SIG{__WARN__} = sub {
        # likeweise
    };

The die/warn message is always the first argument to your handlers. So
you can do whatever you want with it.

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


------------------------------

Date: Mon, 21 Oct 2002 12:13:52 +0100
From: "bengee" <postmaster@localhost.localdomain>
Subject: Re: Replace warn and die
Message-Id: <ap0ngf$vld$1@news0.ifb.net>

"Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote in
message news:ap0mqa$mq4$1@nets3.rz.RWTH-Aachen.DE...
> Also sprach bengee:
>
> > How do i use my own versions of the warn and die functions? Is
this
> > what is know as function overloading?
>
> No, not quite. Functionally it comes close to it, though. You do
that by
> setting a handler for two special signals.
>
>     $SIG{__DIE__} = sub {
>         my $die_msg = shift;
>         print "I died:\n", $msg, "\n";
>     };
>
>     $SIG{__WARN__} = sub {
>         # likeweise
>     };
>
> The die/warn message is always the first argument to your handlers.
So
> you can do whatever you want with it.

Thanks Tassilo.

bengee




------------------------------

Date: Mon, 21 Oct 2002 12:14:06 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <ur7rsesrbrrh6b@corp.supernews.com>

Following is a summary of articles spanning a 7 day period,
beginning at 14 Oct 2002 12:16:04 GMT and ending at
21 Oct 2002 11:44:44 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 2002 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@(?:.*\.)?perl\.com
faq\@(?:.*\.)?denver\.pm\.org
comdog\@panix\.com

Totals
======

Posters:  257
Articles: 855 (357 with cutlined signatures)
Threads:  223
Volume generated: 1717.4 kb
    - headers:    747.5 kb (13,982 lines)
    - bodies:     907.5 kb (30,529 lines)
    - original:   564.3 kb (20,510 lines)
    - signatures: 61.5 kb (1,611 lines)

Original Content Rating: 0.622

Averages
========

Posts per poster: 3.3
    median: 2 posts
    mode:   1 post - 116 posters
    s:      5.5 posts
Posts per thread: 3.8
    median: 3 posts
    mode:   1 post - 55 threads
    s:      3.9 posts
Message size: 2056.9 bytes
    - header:     895.3 bytes (16.4 lines)
    - body:       1086.9 bytes (35.7 lines)
    - original:   675.9 bytes (24.0 lines)
    - signature:  73.7 bytes (1.9 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   50   104.2 ( 42.9/ 55.9/ 28.9)  Benjamin Goldberg <goldbb2@earthlink.net>
   45   105.9 ( 51.5/ 48.3/ 33.9)  tadmc@augustmail.com
   31    75.5 ( 28.9/ 40.5/ 20.9)  tassilo.parseval@post.rwth-aachen.de
   20    32.2 ( 16.6/ 15.0/  4.6)  "John W. Krahn" <krahnj@acm.org>
   20    30.7 ( 19.1/ 11.5/  4.6)  Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
   19    36.0 ( 15.7/ 18.9/ 10.4)  Brian McCauley <nobull@mail.com>
   17    28.8 ( 15.2/ 13.6/  6.0)  "PinkPuppy" <spam@stinks.com>
   15    26.7 ( 12.0/ 11.3/  6.4)  helgi@decode.is
   12    18.8 ( 11.7/  7.0/  3.7)  Bart Lateur <bart.lateur@pandora.be>
   12    28.5 ( 13.8/ 14.7/ 10.8)  "Alan J. Flavell" <flavell@mail.cern.ch>

These posters accounted for 28.2% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 105.9 ( 51.5/ 48.3/ 33.9)     45  tadmc@augustmail.com
 104.2 ( 42.9/ 55.9/ 28.9)     50  Benjamin Goldberg <goldbb2@earthlink.net>
  75.5 ( 28.9/ 40.5/ 20.9)     31  tassilo.parseval@post.rwth-aachen.de
  36.0 ( 15.7/ 18.9/ 10.4)     19  Brian McCauley <nobull@mail.com>
  32.2 ( 16.6/ 15.0/  4.6)     20  "John W. Krahn" <krahnj@acm.org>
  31.2 ( 10.6/ 20.6/ 15.4)     10  Derek Thomson <derek@wedgetail.com>
  30.7 ( 19.1/ 11.5/  4.6)     20  Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
  29.4 (  0.8/ 28.5/ 26.7)      1  "Maurice Moolenaar" <m.moolenaar@mdc-international.com>
  28.8 ( 15.2/ 13.6/  6.0)     17  "PinkPuppy" <spam@stinks.com>
  28.5 ( 13.8/ 14.7/ 10.8)     12  "Alan J. Flavell" <flavell@mail.cern.ch>

These posters accounted for 29.2% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.995  ( 12.8 / 12.9)     11  Jay Tilton <tiltonj@erols.com>
0.812  (  7.5 /  9.3)     10  pkent <pkent77tea@yahoo.com.tea>
0.782  (  9.4 / 12.1)      5  Bodo Schulze <bobesch@letras.net>
0.751  (  2.5 /  3.3)      6  Daniel Pfeiffer <occitan@esperanto.org>
0.745  ( 15.4 / 20.6)     10  Derek Thomson <derek@wedgetail.com>
0.733  ( 10.8 / 14.7)     12  "Alan J. Flavell" <flavell@mail.cern.ch>
0.722  (  2.1 /  2.9)      5  "Rubber Duck" <rubberducky703@hotmail.com>
0.702  ( 33.9 / 48.3)     45  tadmc@augustmail.com
0.683  (  5.8 /  8.5)      7  kit <manutd_kit@yahoo.com>
0.667  (  1.8 /  2.8)      5  "Teh (tî'pô)" <teh@mindless.com>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.399  (  0.7 /  1.8)      5  chris <chris@home.com>
0.399  (  4.6 / 11.5)     20  Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
0.383  (  2.0 /  5.3)      5  "Bill Smith" <wksmith@optonline.net>
0.376  (  5.8 / 15.4)      8  "Aaron Simmons" <asimmons@mitre.org>
0.350  (  3.8 / 10.8)      7  "smackdab" <smackdab1@hotmail.com>
0.330  (  1.1 /  3.3)      6  Andreas =?iso-8859-1?Q?K=E4h=E4ri?= <ak@freeshell.org.REMOVE>
0.329  (  1.9 /  5.7)      8  Uri Guttman <uri@stemsystems.com>
0.318  (  1.7 /  5.2)      9  "Gregory Toomey" <nobody@nowhere.com>
0.309  (  4.6 / 15.0)     20  "John W. Krahn" <krahnj@acm.org>
0.295  (  1.5 /  5.0)      6  "Newbie" <mike_constant@yahoo.com>

48 posters (18%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   28  Array from String
   20  Random Character Picker
   16  Small syntax utility function
   15  Switching from Python to Perl
   14  expanding variables in text strings
   13  Read a single character from STDIN (W98)
   12  array of array?
   11  Opinion on using Perl or JavaScript for Web development
   11  References to substrings
   11  Anything better than eval("\$$class\::x") ?

These threads accounted for 17.7% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  53.2 ( 28.3/ 23.1/ 11.0)     28  Array from String
  42.9 ( 16.5/ 25.4/ 16.9)     15  Switching from Python to Perl
  35.0 ( 14.8/ 18.5/ 10.2)     16  Small syntax utility function
  32.7 ( 19.9/ 12.5/  4.8)     20  Random Character Picker
  31.9 (  9.2/ 22.3/ 18.3)     10  defining subroutines on the fly in a module
  30.7 (  1.7/ 28.9/ 27.0)      2  Newbie: How can I download a file and after that redirect the page to a new html
  28.0 (  9.3/ 17.9/  8.2)     12  array of array?
  25.6 (  2.2/  6.7/  6.6)      3  Sending email with blat.exe through a Perlscript
  25.2 (  9.1/ 15.1/  8.3)     11  References to substrings
  25.0 (  9.0/ 16.0/  9.2)     11  Opinion on using Perl or JavaScript for Web development

These threads accounted for 19.2% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.823  ( 18.3/  22.3)     10  defining subroutines on the fly in a module
0.780  (  2.0/   2.5)      5  !\n  problem
0.736  (  3.0/   4.1)      5  Code explaination
0.696  (  4.3/   6.1)      7  idea to build an online game
0.693  (  1.4/   2.0)      6  tee
0.679  ( 10.5/  15.5)      7  RFC: TraceScalar.pm
0.673  (  4.7/   7.0)      5  extract char from string into an 2x2 array
0.663  ( 16.9/  25.4)     15  Switching from Python to Perl
0.655  (  1.6/   2.4)      9  How to write a wc utility in Perl?
0.639  (  2.2/   3.5)      7  attr proposition: function call performed at compile time

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.438  (  1.3 /  3.1)      7  [cgi] How to read user file
0.427  (  3.9 /  9.2)      6  newbie question ...
0.423  (  1.0 /  2.5)      5  How do I know whether a user specify STDIN or command invocation argument filename
0.422  (  1.3 /  3.0)      5  Sending argument to perl
0.406  (  2.2 /  5.4)      6  Perl and MySql
0.381  (  4.8 / 12.5)     20  Random Character Picker
0.364  (  3.8 / 10.4)     14  expanding variables in text strings
0.361  (  3.0 /  8.3)      6  Controlling recursion depth with File::Find
0.361  (  2.5 /  6.8)      5  Digest::MD5 -> /usr/bin/ld -> can't compile
0.268  (  2.7 /  9.9)      5  Multiple Pings/Second

63 threads (28%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      10  comp.lang.perl.modules
       3  alt.perl
       3  comp.lang.perl
       2  sci.geo.earthquakes
       2  comp.programming
       2  alt.disasters.misc
       2  sci.geo.geology
       1  comp.infosystems.www.authoring.cgi

Top 10 Crossposters
===================

Articles  Address
--------  -------

       6  "E.D.G." <edgrsprj@ix.netcom.com>
       6  "\(#} jpturcaud" <mining_pioneer@hotmail.com>
       2  mgjv@tradingpost.com.au
       2  "Jonas Nilsson" <dzluk8fsxsw0001@sneakemail.com>
       2  100.17706@germanynet.de
       2  "Rob" <cyberob@freemail.nl>
       1  Jay Tilton <tiltonj@erols.com>
       1  "JorkkiS" <jarkko.rantamaki@edu.stadia.no.spam.fi>
       1  cp <cpryce@pryce.net>
       1  "Alan J. Flavell" <flavell@mail.cern.ch>


------------------------------

Date: Mon, 21 Oct 2002 11:45:03 GMT
From: "William Hymen" <t18_pilot@hotmail.spam.com>
Subject: Stopping IIS website
Message-Id: <3NRs9.6878$U97.630709@newsread2.prod.itd.earthlink.net>

I can stop my web server with
Net Stop "World Wide Web Publishing Service"

How do I stop an individual site from command line?
Maybe VB or Perl?

Any examples would be great.

Thanks.

Bill




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4005
***************************************


home help back first fref pref prev next nref lref last post