[8607] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2224 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 1 11:07:41 1998

Date: Wed, 1 Apr 98 08:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 1 Apr 1998     Volume: 8 Number: 2224

Today's topics:
    Re: A SSI question :-) (Rob Greenbank)
    Re: A SSI question :-) <jgoerzen@southwind.net>
    Re: Anon Scalar Expression (was: Evaluate expression in (M. S. Sriram)
    Re: Cgi Perl Programming problem <jdf@pobox.com>
    Re: Dispatching other scripts/programs from within Perl (Andrew M. Langmead)
    Re: File::Find vs. File::Recurse (was Re: file trees) <jdporter@min.net>
    Re: God Help Us All (was: Re: Sneex having problems) <ptimmins@netserv.unmc.edu>
        HELP !!! - Templates within Perl <tkonink@horizon.nl>
    Re: How to generate a Cartesian product of a varying nu <cnwetzel@linguistik.uni-erlangen.de>
    Re: How to read from keyboard without enter? (Gabor)
    Re: Is there a "Newsgroup" for Newbies to Perl? (Joergen W. Lang)
    Re: Is there a "Newsgroup" for Newbies to Perl? <jdporter@min.net>
    Re: Is there a "Newsgroup" for Newbies to Perl? <keithmur@mindspring.com>
        majordomo <jim@fairford.co.uk>
    Re: majordomo <jgoerzen@southwind.net>
    Re: Munging addresses (was: Re: Perl Cgi Questions) (Peter Caffin)
        Perl 5.0.0.5 Main/Activeware come together ? (User)
    Re: Perl BNF/Perl parser <keithmur@mindspring.com>
    Re: PERL Far Eastern Language Support <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
        problem to exec a "c:\Program Files\.." command on Wind <wenwey@webmantech.com>
    Re: Question on one of Abigail's obfuscated sigs (Joel Coltoff)
        random picture for web page (stan zylowski)
    Re: Refcounts when XSUB creates PERL objects. (Ken Fox)
    Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ <andrew@erlenstar.demon.co.uk>
    Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ <mw@tigress.co.uk>
    Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ (Jim Cochrane)
    Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ ("Paul E. Bennett")
    Re: What modules are available on my computer? (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 01 Apr 1998 14:53:38 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Re: A SSI question :-)
Message-Id: <3522549d.59796359@news.frii.com>

Ben,

A word of caution here.  An internet surfer's IP address will ONLY
identify the small percentage whose IP address is fixed, and not
modified by a firewall. 

Most people use a dialup provider, which assigns a different IP
address each time they call in.  A lot of LAN's dynamically assign IP
addresses, too.  In those cases you'll block a bunch of non-banned
callers, and may never block the caller you intended to block.

Another problem is firewall software.  Many firewalls translate all
internal network addresses to a single IP address when a message is
sent out, and then translates it back when the reply is received.  You
will be banning an entire company/organization in that case.  Probably
NOT what you wanted to do.

 I don't know all the details about your situation (internet,
intranet, etc.), so I can't say for sure the above problems will apply
to you.  

Another way you could do the same thing is with a CGI script.  You can
do the same checks you're using SSI for, but it will be hidden from
the user.  The HTML can be copied line-for-line from the existing HTML
file (after the CGI spits out the "Content" line), or it can be
generated.  I use a wrapper of this nature around an error page, which
is used for all "not found" errors, to capture the "HTTP_REFERER"
variable and identify bad links both on our own site and on other
sites.  Lots of cools stuff you can do this way, including session
tracking and statistics gathering.

Hope this helps....

	Rob

On Wed, 1 Apr 1998 02:04:19 +0100, "Ben" <ben@wallroyds.demon.co.uk>
wrote:

>Hello all :-) ...
>
>First of all ... I'm so sorry about my bad English.
>
>I have a .shtml webpage. It runs a CGI script ... The script is to detect
>the surfer's IP address and look up the "Banned surfers" database and if
>it's matched ... It will print "Sorry, but you're banned from viewing the
>page" ... But, the problem is, it also show the *.shtml page in which it
>shouldn't ...
>
>I wonder if anyone can tell me how to tell them that they're banned and NOT
>showing the .shtml page?
>
>The script was written in Perl.
>
>Best Regards
>
>Ben :-)
>
>(PS - I apologise if the newsgroup is the wrong place to post the message or
>if any of you don't like this newcomers' message being around - If so, I'm
>really sorry)
>
>



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

Date: 01 Apr 1998 08:58:32 -0600
From: John Goerzen <jgoerzen@southwind.net>
Subject: Re: A SSI question :-)
Message-Id: <r6z90ppfv1j.fsf@peridot.southwind.net>

"Ben" <ben@wallroyds.demon.co.uk> writes:

> Hello Alan ...
> 
> Thank you very much for the reply :-)
> 
> You described it perfectly.
> 
> I thought that - But, there's a major disadvantage, the search engines, of
> course ... won't search CGI scripts :-)
> 
> Or, can they?

There's no reason that they couldn't unless the CGI scripts require
some sort of input (from a form, a cookie, or something).  However, I
don't know if any search engines as a matter of policy ignore /cgi-bin 
URLs; if so, it is, IMO, a major shortcoming in the search engine.

Given a plain URL, there is no general way to detect that it is CGI or 
not.


-- 
John Goerzen                              Southwind Internet Access, Inc.
E-mail: Business, jgoerzen@southwind.net; Personal, jgoerzen@complete.org
Computer Science Dept., Wichita State University,    jgoerzen@cs.twsu.edu
Developer, Debian GNU/Linux                       <http://www.debian.org>


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

Date: 01 Apr 1998 10:04:16 -0500
From: sriram@maps.tempo.bell-labs.com (M. S. Sriram)
Subject: Re: Anon Scalar Expression (was: Evaluate expression inside print "")
Message-Id: <k2hyaxp1t3j.fsf@maps.research.bell-labs.com>

John Porter <jdporter@min.net> writes:

> So my question is, Why doesn't perl have an operator to
> generate ref-to-anon-scalar the way it does for arrays
> and hashes?

$ perl -de bug
 
Loading DB routines from perl5db.pl version 1
Emacs support available.
 
Enter h or `h h' for help.
 
main::(-e:1):   bug
  DB<1> $a = 3;
 
  DB<2> $b = \($a + 1);
 
  DB<3> X b
$b = SCALAR(0x2b1b64)
   -> 4

	Am I missing something?

- Sriram


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

Date: 01 Apr 1998 08:52:45 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Cgi Perl Programming problem
Message-Id: <sonxfy36.fsf@mailhost.panix.com>

expoinfo@globalexpos.co.nz writes:

> Could anyone with a knowledge in perl please help me with a problem
> in cgi?

Please let us in on the specific nature of your difficulty, including
what you've tried in order to solve it.  I'm sure you'll get plenty of
help.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Wed, 1 Apr 1998 15:32:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Dispatching other scripts/programs from within Perl script
Message-Id: <Eqqr6n.1xz@world.std.com>

Peter Szwedyk <szwedyk@ibm.net> writes:

>I need to capture return codes for programs dispatched into forground.
>As for programs that would be sent into background, I need to be sure
>that the program being dispatched into background was dispatched
>successfullly - that is , it started executing.

[examples deleted]

>I thing that the system function is not appropriate in these cases.
>Could anyone help?

Since system() is just a a combination of the lower level system calls
fork(), exec(), and wait(), (or more likely waitpid()) you could
perform the separate steps yourself and and determine that status
along the way.

For a program "in the background", you just fork() and exec() it,
while not performaing the corresponding wait() (which makes the parent
process sleep until the child is finished.)

If you use waitpid() with the &NOHANG parameter, you collect the exit
status of the process if it is done but not be put to sleep if it is
still running.

-- 
Andrew Langmead


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

Date: Wed, 01 Apr 1998 10:15:15 -0500
From: John Porter <jdporter@min.net>
Subject: Re: File::Find vs. File::Recurse (was Re: file trees)
Message-Id: <35225A02.4E5D@min.net>

Peter Scott wrote:
> 
> File::Recurse allows you to send a parameter to the callback (in lieu
> of supplying multiple root points).  P.681 of the Perl Module Reference:
> 
> "There is an optional third parameter which [...] is passed as the second
> parameter to the user-defined function.  This can be useful for building
> library routines [...] so that they do not have to pass state to the function
> as global variables."

If that's the rationale, then I'll take File::Find.
If you need to pass state to the callback, make the callback a closure.
Closures use lexical variables rather than globals.

John Porter


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

Date: Wed, 01 Apr 1998 09:06:07 -0600
From: Patrick Timmins <ptimmins@netserv.unmc.edu>
Subject: Re: God Help Us All (was: Re: Sneex having problems)
Message-Id: <352257DF.6538@netserv.unmc.edu>

Sneaker's Nest wrote:
> 
> What's so bad about being a newbie is
> one day I can look forward to being
> an old fart.
> 
> A hateful one...

Sneex,

$rule = "perl is nice";
if ($rule =~ /p(e)r(l)( )(i)(s)( )(n)(i)(c)(e)/) {
    print "$5$4$2$1$7$9$10$3$8$5$6go$2d$1$7\n";
}

Hope that helps.

Patrick Timmins
U. Nebraska Medical Center


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

Date: Wed, 01 Apr 1998 17:15:29 +0200
From: "T. de Konink" <tkonink@horizon.nl>
Subject: HELP !!! - Templates within Perl
Message-Id: <35225A11.462EBF02@horizon.nl>

Hi,

I'm looking for a way of using HTML templates within Perl CGI-scripts,
so I can isolate HTML-code (for script-output) from the script-source.
The problem is that the (html-)output contains some variables, which are
used inside the script.

Do you know how to do this (if there is any way of using templates
within Perl) ?

Thanks in advance,
Thomas de Konink

FOCUS internetoplossingen
Postbus 611
6500AP Nijmegen
Telefoon: 024-3789706
Fax: 024-3789706




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

Date: Wed, 01 Apr 1998 17:49:43 +0200
From: Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
Subject: Re: How to generate a Cartesian product of a varying number of sets?
Message-Id: <35226217.E6C@linguistik.uni-erlangen.de>

John Porter wrote:
> =

> Steven Tolkin wrote:
> >
> > 1. How can I handle a variable number of nested loops?
> > 2. It also bothers me that I need to have a hard coded variable at
> >    each level...

> [Code snipped]

> Of course, this can be optimized; for example, if you know you're only
> going to want the product of the vector, you can keep a running
> product down through the recursion.

I re-wrote your example for a function which returns an
array of arrays with the desired cartesian product (instead
of just printing them):


@i=3D (
     [ qw( shoop dee ) ],
     [ qw( shoo bop ) ],
     [ qw( bee a ) ],
     [ qw( doo dee lu ) ],
     [ qw( la dah wah) ] =

);

sub ccp {
   my ($dims,$current,$results) =3D @_;
   my @set =3D @{$dims->[0]};                     # first set in the row
   my $sets_left =3D @$dims-1;                    # how many are left?
   foreach my $element (@set) {                 # iterate through set ele=
ments
      push @$current,$element;                  # add element to current =
product
      if ($sets_left) {
	 my @remaining =3D @$dims[1..$sets_left]; # compute left rows
	 $results =3D ccp(\@remaining,$current,$results); =

						# recursion with decreased dimension
      }
      else {                                    # last set
	 my @current_result=3D@$current;          # create new array for referen=
cing
	 push @$results, \@current_result;      # add product to results
      }                                         #   (pushing @$current wo=
n't work here!)
      pop @$current;                            # pop the last element fr=
om current
   }                                            #   product before return=
ing
   return $results;
}

$r =3D ccp(\@i);                                  =

for (@$r) { print join (' ',@$_), "\n";}        # show the result


Christian
-- =

  Regelm=E4ssig wischen (1-2mal w=F6chentlich), selbst wenn der
  Boden oberfl=E4chlich sauber erscheint. Sonst entsteht ein
  unhygienischer Schmutzfilm, der auf Dauer schadet.



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

Date: 1 Apr 1998 13:08:50 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: How to read from keyboard without enter?
Message-Id: <slrn6i4f7f.cgj.gabor@vnode.vmunix.com>

In comp.lang.perl.misc, Peter Caffin <UCE-trap_synic@omen.net.au> wrote :

[snip]

# The Camel Book really ought to carry an update on the atmosphere of this
# newsgroup now that it's become all snooty and information-lazy *sigh*.

No kidding.  It's interesting that a question like 'why isn't there an
odd function in Perl' generates all sorts of answers, but tougher
questions go unanswered.
This newsgroup is definitely not like one would expect from reading
the Camel.

# --:     _         ___  _    _ _ 
#  _oo__ |_|_ |__  _ |  |  _ |_|_' _   synic at omen dot net dot a u
# //`'\_ | (/_|(/_| .|. |_(_|| | || |  http://www.omen.net.au/~synic
# /              PO Box 869, Hillarys WA 6923, AUSTRALIA


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

Date: Wed, 1 Apr 1998 14:58:27 +0200
From: joergen.lang@schwaben.de (Joergen W. Lang)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <1d6t6sk.vsi1ay1nj6b8gN@host009-206.seicom.net>

As this thread is very complex I'd rather see myself quoted within
context - just to avoid confusion.
My original post was a reply in agreement to a post of Uri Guttman:

> Uri Guttman <uri@sysarch.com> wrote: 
> > > again, if the not so newbies helped the newbies, we experts can help
> > > them. 

Joergen:

> But where are they ? Right now the situation seems to be a bit like:
> 
> newbie ---void---void---void---void---void--- expert
> 
> I probably fit in somewhere between the two leftmost "voids"s and only
> start to get confident enough to share my knowledge. I'm quite sure
> there's more not-so-newbies out there, who could contribute.

Thanks, Joergen

Chris Vogel <C.VOGEL@LINK-GOE.de> wrote:

>                                            Goettingen, Stardate 0930.00 Hi
> Hi there,
> 
>   joergen.lang (Joergen W. Lang) wrote in
>   1d60032.ljml7cpmmvwgN@host026-206.seicom.net on 31.03.98 following
>   lines, starting with '*'
> 
> * newbie ---void---void---void---void---void--- expert 
>           to scared by some postings to write
> 
> Chris.
> 
> 
> -- Der redet heute wieder Amok...


-- 
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"
-------------------------------------------------------------------


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

Date: Wed, 01 Apr 1998 09:57:12 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <352255C8.168E@min.net>

Jeffrey wrote:
> 
> All this is ignorace. I don't give a fat ass who wants to help. Free
> help is good help. If the person is qualified or not. Sometimes an
> unqualified person has good things to teach to.

Umm, that doesn't quite make sense to me.  If a person has good
things to teach, then he is, in that respect at least, qualified.

That's one of the major problems with any newsgroup which is populated
mostly by good-intentioned newbies: quite often, they give wrong
or misleading answers.  That's not help, that's destructive.

John Porter


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

Date: Wed, 01 Apr 1998 11:00:08 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <35227297.BF419C8C@mindspring.com>

Randal Schwartz wrote:
> 
> >>>>> "smitty77" == smitty77  <smitty77@pacbell.net> writes:
> 
> smitty77> My first experience with perl was in a class at Silicon
> smitty77> Graphics taught by Randall Schwartz.  It was a pretty good
> smitty77> class, but even then I could tell that Randall had no
> smitty77> patience for people who asked what he felt were 'stupid
> smitty77> questions'.  To each his own, I guess.
> 
> I'm a bit flabberghasted by this.  It's not my intention to come
> across as someone who "had no patience for people who asked what he
> felt where 'stupid questions'".  Since you've broadsided me, I'm gonna
> ask you why you didn't come up to me in class to tell me your
> perception, or at least write it down on the readily available SGI
> "eval" forms at the end of the week.  If you can relate a specific
> conversation in detail, I'll be happy to attempt to recall the
> situation and try to understand what happened.
> 
Not taking sides on what happened, didn't happen (how could I, not being
there?), but I'd just like to share one of my few insights gained in
life:

If you intimidate people, they will *never* tell you to your face. 
Almost by definition.

You will be embarrassed publicly.  Or wonder why people don't ask you
questions.

And shifting the blame or burden of proof onto them just makes matters
worse.  It is up to *you* to pick up on social cues and change your
behavior (if you really want to; sometimes intimidation is useful).

Not saying any of this applies to Randal Schwarz, for whom I have the
greatest respect.


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

Date: 1 Apr 1998 12:40:37 GMT
From: "jim" <jim@fairford.co.uk>
Subject: majordomo
Message-Id: <01bd5d6b$60258f40$0200a8c0@fairford>

Hi, 
I'm new to Perl. What I want is to run majordomo (or another mailing list
program) 
on a win95 machine.
any pointers would be gratefully received.

	<jim@fairford.co.uk> 


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

Date: 01 Apr 1998 09:00:45 -0600
From: John Goerzen <jgoerzen@southwind.net>
Subject: Re: majordomo
Message-Id: <r6z7m59fuxu.fsf@peridot.southwind.net>

I doubt that this will be possible since Majordomo requires the
services of a Unix Mail Transfer Agent (MTA) such as sendmail.  These
things just simply aren't available for Windows 95.

You can, however, run Perl in general under Windows 95 -- there are
details at www.perl.com.

John

"jim" <jim@fairford.co.uk> writes:

> Hi, 
> I'm new to Perl. What I want is to run majordomo (or another mailing list
> program) 
> on a win95 machine.
> any pointers would be gratefully received.
> 
> 	<jim@fairford.co.uk> 

-- 
John Goerzen                              Southwind Internet Access, Inc.
E-mail: Business, jgoerzen@southwind.net; Personal, jgoerzen@complete.org
Computer Science Dept., Wichita State University,    jgoerzen@cs.twsu.edu
Developer, Debian GNU/Linux                       <http://www.debian.org>


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

Date: Wed, 01 Apr 1998 15:14:01 GMT
From: UCE-trap_synic@omen.net.au (Peter Caffin)
Subject: Re: Munging addresses (was: Re: Perl Cgi Questions)
Message-Id: <352257d8.1077128@news.omen.net.au>

Tom Phoenix <rootbeer@teleport.com> did cunningly address to
comp.lang.perl.misc..
:On Tue, 31 Mar 1998, Karl Dyson wrote:
:
:> I don't want to disgress too much but changing the reply-to addresses
:> etc. etc. *will* stop many spam spiders. Many pieces of software for
:> grabbing email addresses from newsgroups only read the header not the
:> whole message.
:
:Really? I've never seen one that does that. Have you? Did you write it
:yourself? :-)

Think about what's more efficient when it comes to talking NNTP.
You could check far more articles by pulling down the header only for three
newsgroups than checking the headers+bodies of one. Commonsense. [1]

:Why not do that? Because most folks won't bother to un-munge; I know I
:won't. Cheers!

Who cares about the lazy? ;).

====
[1] Nope, I haven't been writing email-address grabbing software lately. I've
been writing a script that grabs URLs [2] ;). I have no plans to ever write
the former during my lifetime.
[2] Nearly finished. All the main stuff out of the way. It's a good learning
experience. I'm learning lots about sockets and other associated nicknacks :).

--:     _         ___  _    _ _ 
 _oo__ |_|_ |__  _ |  |  _ |_|_' _   synic at omen dot net dot a u
//`'\_ | (/_|(/_| .|. |_(_|| | || |  http://www.omen.net.au/~synic
/              PO Box 869, Hillarys WA 6923, AUSTRALIA


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

Date: Wed, 01 Apr 1998 15:32:32 GMT
From: you@somehost.somedomain (User)
Subject: Perl 5.0.0.5 Main/Activeware come together ?
Message-Id: <35225d94.102452498@news.btinternet.com>

Any pointers to dates as to wether the proposed coming together of
Activestates, and "main stream" is still on course, and what sort of
time scales are involved ?

tried www.perl.com/.org and activestate, no dates anywhere ?

Any ideas anyone ?


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

Date: Wed, 01 Apr 1998 10:27:43 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl BNF/Perl parser
Message-Id: <35226AFF.D0B8A2E9@mindspring.com>

Lasse Hillerxe Petersen wrote:
> 
[cut]
> 
> Are there (m)any languages that have a _pure_ BNF? Algol60 maybe?

I'm so boring, I *liked* Algol.  Only encountered it in college, though.
>
[cut]
> Having a Linux machine under the kitchen table to
> control the coffee machine seems a bit extreme.
> 
Surely a JVM would be perfect for this.  ;-)


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

Date: Wed, 1 Apr 1998 06:07:55 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: PERL Far Eastern Language Support
Message-Id: <6fthjl$ae7@bgtnsc03.worldnet.att.net>

I'm afraid you have to find a version of Perl that supports double byte
character sets. Perl was written to support ASCII, and some odd things can
happen when you try to use other encoding methods. There was an article in
the Perl Journal not too long ago about using EBCDIC with Perl, but again,
EBCDIC is a single-byte encoding so I'm not sure that would help you too
much.

If you're looking to run this on a Win32 machine, there's a note on the
ActiveState home page (http://www.activestate.com) written in Japanese, so I
can't read it, but it makes reference to something like Perl-J. Otherwise
I'd say just do a Lycos or Excite search for "perl japanese" and see what
comes up. You should also check CPAN (http://www.cpan.com) to see if there
are any Japanese or Unicode modules that would help you. Good luck!

--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl

Christian wrote in message
<891435341.17580.0.nnrp-03.c2d90c94@news.demon.co.uk>...
>I am attempting to convert an application from English into Japanese. This
>application seems to make very heavy use of Perl, which I admit I don't
know
>much about. I would like to know if Perl supports the use of double byte
>character systems (i.e. EUC) or Unicode. I couldn't find anything in the
>FAQs, except something about locale support which does not mention double
>byte languages.
>
>If anyone can help, whether the news is good or bad, could they mail as
well
>as post, as there are so many messages in this group I might miss something
>useful. Don't forgot to unmangle the return address.
>
>Thanks.
>
>Christian
>
><chris@cmcardle.demon.removespamfilter.co.uk>
>
>
>




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

Date: Wed,  1 Apr 1998 10:41:19 EST
From: WenWey Hseush <wenwey@webmantech.com>
Subject: problem to exec a "c:\Program Files\.." command on Windows NT
Message-Id: <6ftn6v$him$1@earth.superlink.net>

We have a Perl script running on both Windows NT and Unix environments.
The script basically invokes (i.e. exec ) a Java program. It works in
most cases except for the path name containing spaces, which only
happens on Windows NT.

   1. works.

   exec "c:\jdk1.1.4\bin\java", "TestJava", "-classpath", ....

   2. doesn't work.

   exec "c:\Program Files\JavaSoft\jre\1.1\jre", "TestJava",
"-classpath", ...
                            ^
                          a space here

   It reports "Class not found: Files\JavaSoft\jre\1.1\bin\jre". The
Java VM
   (c:\Program Files\JavaSoft\jre\1.1\jre) started, but it seemed to
take    "Files\JavaSoft\jre\1.1\bin\jre" as its argument.

If anyone knows a solution to this problem, please reply and also email
to wenwey@webmantech.com. Thanks.





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

Date: Wed, 1 Apr 1998 14:28:45 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Question on one of Abigail's obfuscated sigs
Message-Id: <6ftiu2$s9u@netaxs.com>

In article <Pine.GSO.3.96.980331203247.13245J-100000@user1.teleport.com>,
Tom Phoenix  <rootbeer@teleport.com> wrote:
>On Tue, 31 Mar 1998, Just Another $wanna{$be} Perl Hacker wrote:
>
>> 	s/(..)z?/qq'print chr 0x$1 and \161 ss'/ee;

I had no problem understanding the script and applaud her creativity.
The second line I saw looked a bit different but the above serves as a
good starting place for my question.

Why doesn't it work when the last pair of quote delimters are
semicolon and not 's'?

   	s/(..)z?/qq'print chr 0x$1 and \161 ;;'/ee;

I have no problem (other than readability suffers a little) when
I do the following

	$x = q;this works;;

Thanks

-- 
Joel Coltoff

I'd explain it, but there's a lot of math. -- Calvin


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

Date: Tue, 31 Mar 1998 21:14:44 LOCAL
From: stanz@en.com (stan zylowski)
Subject: random picture for web page
Message-Id: <stanz.1.00086595@en.com>

hello,
i am new to perl. but i would like to know if there are any random picture 
scripts or random quote scripts.  i am familiar with javascript but
want to offer random functions to all browsers

thank you.
stan


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

Date: 1 Apr 1998 15:10:59 GMT
From: kfox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: Refcounts when XSUB creates PERL objects.
Message-Id: <6ftle3$7n91@eccws1.dearborn.ford.com>

[mailed and posted]

Alan McKenney <alanm@ilx.com> writes:
> Can anyone explain [mortals] in a clear way?

Have you read perlguts.pod yet?  Here's a quote from there:

| There are some convenience functions available that can help with the
| destruction of xVs.  These functions introduce the concept of "mortality".
| An xV that is mortal has had its reference count marked to be decremented,
| but not actually decremented, until "a short time later".  Generally the
| term "short time later" means a single Perl statement, such as a call to
| an XSUB function.  The actual determinant for when mortal xVs have their
| reference count decremented depends on two macros, SAVETMPS and FREETMPS.
| See L<perlcall> and L<perlxs> for more details on these macros.
|  
| "Mortalization" then is at its simplest a deferred C<SvREFCNT_dec>.
| However, if you mortalize a variable twice, the reference count will
| later be decremented twice.

> In my C subroutine, I create an array-of-arrays; more exactly, I
> return a  reference to an array of references to arrays.
> 
> I do this by the following steps:
> 
>   - I create an AV for the first row (which will be filled in last)
>     using "newAV".

Ok.

>   - I create an RV for the first row, using "newRV", and use it
>     to create the top-level array, using "av_make( 1, &reference )".

You probably want the newRV_noinc form because the count on the AV
is 1 when you first create it and that's what it should be when you
put it in the array.  Don't mortalize things in the array.

>   - Inside the loop (over "rows"), I:
> 
>     + Fill up a C array of SV *'s using the "newSVxx" functions.

Ok.

>     + Create a (filled) AV using "av_make".

It might be easier to just create an empty AV of the right size (to
eliminate Perl having to grow the array) and then just use av_store
to fill it directly.  This avoids having to use a temporary C array
of SV *.

>     + Release the SV's by using SvREFCNT_dec on each element of the
>       C array.

If you keep on using av_make you'll have to do this because av_make
copies the elements.  However, if you use av_store instead of av_make
then you don't want this.  Assuming that you haven't mortalized the
array elements (and you shouldn't!), the ref count on them will be 1.
This is what you want.

>     + Get an RV to the AV using "newRV" on the AV.

Use newRV_noinc again.

>     + Push the RV onto the top-level array. (using av_push)

Ok.

>   - When the loop is finished:
> 
>   - I fill in the first row using av_push on SV's created with
>     newSVxx.

Ok.  (Not clear about why your algorithm works this way though.
It seems like you're using a lot of temporaries when you could
just build the data structure in place.)

>   - I then create an RV to the top level array, and set RETVAL
>     to that.

The RV that you push on the stack (i.e. the return value) must
be mortal.  If you're using a CODE: section in an XSUB, xsubpp will
generate the code for you.  If you're using a PPCODE: section then
you'll have to mortalize it yourself.

Whenever you have doubts, always take a quick scan through the
output of xsubpp to make sure that your understanding matches the
reality of xsubpp.

> *Now*: I don't want these things to hang around forever.

If you mark the RV return value as mortal, its ref count will be
decremented sometime (usually soon) after the return.  Since the
AV only has a ref count of 1 (only the RV return value points to
it) the AV will be destroyed as soon as the RV is destroyed.  When
the AV is destroyed, all the elements in the AV are decremented.

> Originally, I had the impression from the PERLGUTS document that
> that all SV/RV/AV/... objects started out with a refcount of 1, and
> that putting them -- or a reference to them -- into an array or
> reference would bump up the refcount.

No.  The perlguts.pod documentation says:

|     SV**  av_store(AV*, I32 key, SV* val);
|  
| ...
|
| The C<av_store> function stores the value C<val> at index C<key>, and does
| not increment the reference count of C<val>.  Thus the caller is responsible
| for taking care of that, and if C<av_store> returns NULL, the caller will
| have to decrement the reference count to avoid a memory leak.

> So I made a "sv_2mortal" call on everything.

You should only mortalize things going on the stack.

> I finally ended up making the AV's mortal, but not the RV's.
> The SV's in the C array I still did SvREFCNT_dec on with no
> problem, but the SV's I passed to av_push I could not get away
> with making mortal.  It works, but makes no sense at all to me.

More likely than not it isn't working. ;)

The excessive number of increments going on might balance the
excessive number of mortalizations, but I wouldn't bet on it...

> (a) Could someone explain exactly what functions and actions
>     modify the reference count, and under what circumstances?

RTFM.  There are way too many functions to list here.

> (b) Is there any difference between "making an SV/... mortal" and
>     "decrementing an SV/...'s reference count"?

Mortalization is a *delayed* ref count decrement, so, yes, there
is a big difference.

> (c) Under what circumstances should an SV/... be explicitly made
>     mortal, and when not?

Normally whenever you put an SV on the stack it should be made
mortal.  You should also make temporary values mortal if your code
can't guarantee that they'll always be cleaned up (e.g. if you
create a non-mortal SV and then call a perl sub, the sub may die
and then you have a leak).

> I'm using PERL version 5.003

You should try to upgrade to 5.004.  There were a lot of really
nice bug fixes made in 5.004.

- Ken

-- 
Ken Fox (kfox@ford.com)                  | My opinions or statements do
                                         | not represent those of, nor are
Ford Motor Company, Powertrain           | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section             | "Is this some sort of trick
                                         |  question or what?" -- Calvin


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

Date: 01 Apr 1998 15:46:05 +0100
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <87afa5y502.fsf@erlenstar.demon.co.uk>

>>>>> "Bert" == Bert Bril <bert@dgb.nl> writes:

 > Daniel P. B. Smith wrote:
 >> It was recently pointed out to me that "one furlong per fortnight"
 >> is almost exactly 1 centimeter per minute.  How's that for useful?

 Bert> Is there something wrong here? Is a furlong 201.6 m?

Sounds about right. Hmm. Let's see:

  1 furlong == 1/8 mile == 660 feet == 201.2 m

-- 
Andrew.


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

Date: Wed, 01 Apr 1998 16:15:52 +0100
From: Mark Warren <mw@tigress.co.uk>
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <35225A28.1F69@tigress.co.uk>

Bert Bril wrote:
> 
> Is there something wrong here? Is a furlong 201.6 m?
> Or should it be '1 centimeter per hour'?
> In which case a furlong is a more comprehensible 3.36 m.
> 
> Bert

There are 8 furlongs in a mile, making one furlong 220 yards. Which
according to my arithmetic is 201.17 m.

-------------------------------------------------------------------------------
Mark Warren      | PGS Tigress (UK) Ltd.       | Tel: +44 1224 706763
                 | Exploration House           | Fax: +44 1224 706082
                 | Exploration Drive, Aberdeen | 
                 | Scotland AB23 8GX           | Email: mw@tigress.co.uk
-------------------------------------------------------------------------------


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

Date: 1 Apr 1998 08:28:39 -0700
From: jtc@jupiter.milkyway.org (Jim Cochrane)
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <6ftmf7$dkj@jupiter.milkyway.org>

In article <35223271.61604E90@dgb.nl>, Bert Bril  <bert@dgb.nl> wrote:
>Daniel P. B. Smith wrote:
>> It was recently pointed out to me that "one furlong per fortnight"
>> is almost exactly 1 centimeter per minute.  How's that for useful?
>
>Is there something wrong here? Is a furlong 201.6 m?
>Or should it be '1 centimeter per hour'?
>In which case a furlong is a more comprehensible 3.36 m.
>

[This is off-topic, but the whole thread is off-topic anyway (except
for comp.software.year-2000), so ...]

Speaking of the year2000 problem, has anyone checked out the
postings in comp.software.year-2000?  There are a lot of very experienced
programmers working on the problem saying some rather frightening things
about what the consequences will be (quick summary:  the situation is
a lot worse than most people think it is).


Jim Cochrane
jtc@dimensional.com


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

Date: Wed, 01 Apr 98 15:33:27 GMT
From: peb@transcontech.co.uk ("Paul E. Bennett")
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <891444807snz@transcontech.co.uk>

In article <35223271.61604E90@dgb.nl> bert@dgb.nl "Bert Bril" writes:

> Daniel P. B. Smith wrote:
> > It was recently pointed out to me that "one furlong per fortnight"
> > is almost exactly 1 centimeter per minute.  How's that for useful?
> 
> Is there something wrong here? Is a furlong 201.6 m?
> Or should it be '1 centimeter per hour'?
> In which case a furlong is a more comprehensible 3.36 m.

As it stretched my memory so far back (more than 30 years) I contacted 
our local bookmaker (turf accountant) for confirmation.

The measures are:

   1 mile = 8 furlongs
   1 furlong is 10 chains
   1 chain is 22 yards.

Therefore a furlong is 220 yards which is 201.16 metres.

So one furlong per fortnight is 9.97 mm per hour (near enough to 1 cm 
per hour).

Incidently, a chain is the length of the playing surface of a cricket 
pitch.

-- 
Paul E. Bennett ................... <peb@transcontech.co.uk>
Transport Control Technology Ltd.   <http://www.tcontec.demon.co.uk/>
+44 (0)117-9499861                  <enquiry@transcontech.co.uk>
Going Forth Safely



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

Date: Wed, 01 Apr 1998 17:16:05 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: What modules are available on my computer?
Message-Id: <lassehp-0104981716060001@ygdrasil.imv.aau.dk>

In article
<14953E9BAF17D111926800805FA66B7102E1B804@hermes.atos-group.com>, "R.
Allen Conway" <raconway@atos-group.com> wrote:

>How can you get the list of modules that have been installed on a
>computer?

(Obnixious HTML stuff deleted)
perldoc perllocal

-Lasse


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 2224
**************************************

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