[9839] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3432 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 12 19:07:10 1998

Date: Wed, 12 Aug 98 16:00:24 -0700
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, 12 Aug 1998     Volume: 8 Number: 3432

Today's topics:
        "Enterprise Perl Beans" ;-) paul@iscusa.com
    Re: A Regexp problem <tchrist@mox.perl.com>
    Re: A Regexp problem (Craig Berry)
    Re: A Regexp problem (Patrick Timmins)
        Browser/Plugin detecting using perl cgi <pablo@oven.com>
    Re: Browser/Plugin detecting using perl cgi <ccunning@socrates.mps.ohio-state.edu>
    Re: Calling closure syntax <jdporter@min.net>
    Re: Calling closure syntax <jdf@pobox.com>
    Re: CGI.pm and NT garbled GIF uploads <rootbeer@teleport.com>
        DBI, LD_LIBRARY_PATH, and the web <gcs@swl.msd.ray.com>
        exit code of pipe <bruce.w.mohler@saic.com>
    Re: File::Copy <rra@stanford.edu>
    Re: formmail.cgi... any cgi <rootbeer@teleport.com>
    Re: Help! Please, on the avaliable Perl Modules. <rootbeer@teleport.com>
    Re: hiding user input (Eric Schissel)
    Re: How do you disable LWP auto-redirect on 302? <aas@sn.no>
    Re: lexically scoped aliases <matthies@fsinfo.cs.uni-sb.de>
    Re: lexically scoped aliases <matthies@fsinfo.cs.uni-sb.de>
        make test error in compiling Perl under AIX 4.2.1 <o10382@email.mot.com>
        need help making WBT system <jtnt@nospammindspring.com>
        Opening a file as "+>>file" (Phil Taylor)
    Re: Perl 5.005.1 core dumps under Irix 6.2 (Greg Bacon)
    Re: Perl Newbie script error <rootbeer@teleport.com>
        print() acting strangely on Win32 <briant@packeteer.com>
    Re: RE engine vs. Perl (Ilya Zakharevich)
    Re: re first language <alexk@alexk.appliedtheory.com>
    Re: Run perl script "in-line"? (Andreas Hack)
    Re: Using 2 delim's causing problems? <jdf@pobox.com>
        Using PERL5 with NT4 Peer Web Services <dslevine@flash.net>
    Re: What is the purpose of Perl <jdporter@min.net>
    Re: What is the purpose of Perl <jdporter@min.net>
    Re: What is the purpose of Perl (Bob Trieger)
    Re: What is the purpose of Perl (Gary L. Burnore)
    Re: What is the purpose of Perl (Craig Berry)
        Win NT Formmail and opening temporary files peaceml@erols.nospam.com
    Re: X-file (?=...), case postponed. (Ilya Zakharevich)
    Re: X-file (?=...), case postponed. (Patrick Timmins)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 12 Aug 1998 21:00:47 GMT
From: paul@iscusa.com
Subject: "Enterprise Perl Beans" ;-)
Message-Id: <6qsvq0$jpo$1@nnrp1.dejanews.com>

Hi All,

 Some outline resides at:
 http://www.iscusa.com/~paul/home/pas.html

 I would be glad to receive your feedback / ideas by e-mail.

 Even it has some drawbacks  - it's just few hours of work -
 I see no other way to write complicate, efficient,
 server-platform-perlbuild independent CGI's...

Rgds.Paul.

paul@qub.com
http://www.qub.com/group/

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 12 Aug 1998 20:58:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A Regexp problem
Message-Id: <6qsvll$920$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, "Matthew J. Forder" <mjforder@earthling.net> writes:
:Oops! I apologise...I was working off the top of my head, and I couldn't
:remember if the \q and \e needed to be capitilised. I guess that's what
:I get for leaving all my books at work eh ;-)

That wasn't my concern.  My concern was that you *cannot* use a regular
expression to extract tags from arbitrary HTML.  See perlfaq9.

--tom
-- 
    Be consistent.
            --Larry Wall in the perl man page 


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

Date: 12 Aug 1998 21:12:41 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: A Regexp problem
Message-Id: <6qt0g9$8so$1@marina.cinenet.net>

Tom Christiansen (tchrist@mox.perl.com) wrote:
: In comp.lang.perl.misc, "Matthew J. Forder" <mjforder@earthling.net> writes:
: :Oops! I apologise...I was working off the top of my head, and I couldn't
: :remember if the \q and \e needed to be capitilised. I guess that's what
: :I get for leaving all my books at work eh ;-)
: 
: That wasn't my concern.  My concern was that you *cannot* use a regular
: expression to extract tags from arbitrary HTML.  See perlfaq9.

And who said anything about HTML?  The original poster refered to "in a
document," and the tags given as examples don't appear to be HTML.  It may
well be the case that his particular docs and tags are non-nesting and
otherwise well-behaved enough to be dealt with via regex.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Wed, 12 Aug 1998 22:22:44 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: A Regexp problem
Message-Id: <6qt4jj$r2i$1@nnrp1.dejanews.com>

In article <35D1EA60.A0278F24@earthling.net>,
  "Matthew J. Forder" <mjforder@earthling.net> wrote:
> Try this
>
> /\q$OPENTAG\e/
> /\q$CLOSETAG\e/
>
> the \q \e are the quote delimiters which tell perl to ignore any metachars.
>
> Matthew Forder
[snip]

This is wrong. \Q and \E instead.

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 12 Aug 1998 17:19:45 -0400
From: Pablo Schklowsky <pablo@oven.com>
Subject: Browser/Plugin detecting using perl cgi
Message-Id: <35D206F1.F6A0F335@oven.com>

I'm trying to put together a cgi to act instead of javascript to detect
plugins (specifically, shockwave and flash).  First of all, is this at
all possible?  If it is possible, how would I go about doing it?  Are
there environment variables which would tell me?  Which modules should I
be looking at?  Thanks in advance,

    =p=

---
Pablo Schklowsky
OVEN Ditgital
212-253-2100 x. 218



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

Date: Wed, 12 Aug 1998 17:45:47 -0400
From: Chad Cunningham <ccunning@socrates.mps.ohio-state.edu>
To: Pablo Schklowsky <pablo@oven.com>
Subject: Re: Browser/Plugin detecting using perl cgi
Message-Id: <35D20D0A.2D6FE3FB@socrates.mps.ohio-state.edu>

No. The only way you can really do that is with JavaScript.

Pablo Schklowsky wrote:

> I'm trying to put together a cgi to act instead of javascript to detect
> plugins (specifically, shockwave and flash).  First of all, is this at
> all possible?  If it is possible, how would I go about doing it?  Are
> there environment variables which would tell me?  Which modules should I
> be looking at?  Thanks in advance,
>
>     =p=
>
> ---
> Pablo Schklowsky
> OVEN Ditgital
> 212-253-2100 x. 218





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

Date: Wed, 12 Aug 1998 17:39:00 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Calling closure syntax
Message-Id: <35D20B74.75F@min.net>

Matt Knecht wrote:
> 
> To call it I say:
> 	&$code_ref($arg1, $arg2);
> Which, to me, is pretty ugly looking. 
> Is there a way to clean up this syntax?  

Have you considered

	$code_ref->( $arg1, $arg2 );

???  

I much prefer it.

-- 
John Porter


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

Date: 12 Aug 1998 18:46:57 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: hex@voicenet.com (Matt Knecht)
Subject: Re: Calling closure syntax
Message-Id: <u33hkbke.fsf@mailhost.panix.com>

hex@voicenet.com (Matt Knecht) writes:

> In my current quest to try and grok OO programming, I'm at an annoying
> point with closures.

I'm not sure how closures are related to objects, but I might still be
of some help.

> &$code_ref($arg1, $arg2);
> 
> Which, to me, is pretty ugly looking.  Is there a way to clean up this
> syntax?

This might give you an idea or two...

   my $code_ref = sub { print "foo\n" };
   local *code = $code_ref;
   code();

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 12 Aug 1998 21:28:40 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI.pm and NT garbled GIF uploads
Message-Id: <Pine.GSO.4.02.9808121428160.10161-100000@user2.teleport.com>

On Wed, 12 Aug 1998, Bill Mezian wrote:

> binmode(STDERR);

Are your error messages really binary? :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 12 Aug 1998 15:52:58 -0400
From: Garth C Sainio <gcs@swl.msd.ray.com>
Subject: DBI, LD_LIBRARY_PATH, and the web
Message-Id: <35D1F29A.4AED02AB@swl.msd.ray.com>

Hi,

	I'm trying to develop a script that will interface with an Ingres
database and display the results to a web page. All works fine as long
as the script is being run from an account with the LD_LIBRARY_PATH
environment variable set but the uid that runs cgi scripts does not have
this set. Thus, I get the following error "install_driver(Ingres)
failed: Can't load (bunch of meaningless pathnames)..." I have tried to
set this environement variable in the script using
$ENV{'LD_LIBRARY_PATH'}= but I still get the error in loading driver.
When I run it from the command in an environment without LD_LIBRARY_PATH
set the script fails, when I run the script and set the environment
variable as described above it fails, the only way I can get it too work
is too do a setenv LD_LIBRARY_PATH on the command line and then run the
script. The problem with setting the variable in the script seems to be
that the code called by the install_driver function in the DBI library
does not seem to get the information about the value of the environment
variable.

Does anyone have any suggestions on other things to try?

Thanks,

Garth


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

Date: Wed, 12 Aug 1998 15:38:10 -0700
From: Bruce Mohler <bruce.w.mohler@saic.com>
Subject: exit code of pipe
Message-Id: <35D21952.E6F98E4@saic.com>

I'm trying to capture the exit code of a pipe.  I've checked the Blue
Camel and
Perl FAQ without finding an answer yet.

I'm trying to

    open CMDOUTPUT, "( $Program $CmdLineArgs 2>&1; echo \"exit=$?\" |"
or
        die "Can't capture command output: $?";
    @CommandOutput = <CMDOUTPUT>;
    close(CMDOUTPUT);

I realize that what is returned from the open command is the process ID
of the
subprocess.  I figured I'd execute the program inside of a sub-process,
echo the
exit code of the previous process, and capture it as the last line of
output in the
@CommandOutput array of text.  What always gets echoed is "0" (zero)
rather than what the Program is actually exiting with.

When I run this on the command line, it properly echoes the exit code of
the
program, so something is happening here that is escaping me.

My goal is to capture the output of the program and its exit code.  Any
suggestions?

Thanks, in advance.

Bruce

--
Bruce W. Mohler                619-458-2675 (voice)
SAIC/ITS/Server Support        619-535-7806 (fax)
Sr UNIX system administrator   888-781-5697 (pager)
                               mailto:bruce.w.mohler@saic.com
Of course my password is the same as my pet's name.
My dog's name is Q47pY!3, but I change it every 90 days.




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

Date: 12 Aug 1998 14:52:35 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: File::Copy
Message-Id: <m3lnotvpek.fsf@windlord.Stanford.EDU>

Gabor <gabor@vmunix.com> writes:
> In comp.lang.perl.misc, Russ Allbery <rra@stanford.edu> wrote:

>> Nope.  You need to read them in from the source file and reapply them
>> to the destination, and I don't know of a platform-independent way of
>> doing that.  For Unix, you'd do something like:

> If you use File::NCopy, it will do it for you.  Plus it can recursively
> copy directories or more than one file to a directory.

I assume that it still doesn't solve the platform-independence problem?

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Wed, 12 Aug 1998 21:19:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: formmail.cgi... any cgi
Message-Id: <Pine.GSO.4.02.9808121418130.10161-100000@user2.teleport.com>

On 12 Aug 1998, Marjorie MacDonald wrote:

> The service we use to host our web site has set me up a CGI directory.
> First of all, it is NOT under my normal HTML directory, it's at a
> completely different URL. Is this normal? Does this cause problems? 

Maybe you should check with a newsgroup about CGI programming and related
issues. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 12 Aug 1998 21:26:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help! Please, on the avaliable Perl Modules.
Message-Id: <Pine.GSO.4.02.9808121425430.10161-100000@user2.teleport.com>

On Wed, 12 Aug 1998, Jack Xie wrote:

> Subject: Help! Please, on the avaliable Perl Modules.

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

>         I am looking to a Perl Module that can auto lay out a tree
> shape data sturcture. I hope it's has a GUI interface. Could anybody
> give me some insight or hint?

If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)  Hope this helps!

    http://www.perl.org/CPAN/
    http://www.perl.com/CPAN/

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 12 Aug 98 22:58:14 GMT
From: schissel@adore.lightlink.com (Eric Schissel)
Subject: Re: hiding user input
Message-Id: <35d21e06.0@news2.lightlink.com>

Miguel Cruz (mnc@diana.law.yale.edu) wrote:
>In article <6qn5bk$1q7$1@nnrp1.dejanews.com>,  <birgitt@my-dejanews.com> wrote:
>>So, if the server and the circuits are not public ones, I would
>>have thought that the posts too are not public posts.

>I don't understand this logic. I can not think of very many (okay, some,
>save your fingers) "public" things in the United States which do not depend
>entirely or in part on private technology and infrastructure. Does private
>contaminate public?

Curiously, private industry in the US is at least, if not more, dependent
on publicly-funded R&D.  And are the roads "private"?  To my mind you have
your finger on a very important, rarely-realized point- but you have it
exactly backwards.

Ob Perl:  this same thread (on hiding user input) recently started,
continued, and ended on the MacPerl list- without a hint of the rancor
that seems to have hit it here...

-Eric Schissel

--
schissel@lightlink.com
http://www.lightlink.com/schissel ICQ#7279016
standard disclaimer


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

Date: 12 Aug 1998 23:05:05 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: How do you disable LWP auto-redirect on 302?
Message-Id: <m31zqldi7y.fsf@furu.g.aas.no>

"Jon C. Hodgson" <jon@resonate.com> writes:

> How do you disable LWP auto-redirect on 302?

Use $ua->simple_request() instead of $ua->request().

-- 
Gisle Aas


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

Date: 12 Aug 1998 21:46:46 GMT
From: Niklas Matthies <matthies@fsinfo.cs.uni-sb.de>
Subject: Re: lexically scoped aliases
Message-Id: <6qt2g6$qcg$1@hades.rz.uni-sb.de>

In comp.lang.perl.misc, Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, 
>     Niklas Matthies <matthies@fsinfo.cs.uni-sb.de> writes:
> :i.e. what
> :one might expect that 
> :
> :  my *foo = \$bar;
> :
> :would do if it were legal?
> 
> Using local there is not particularly dangerous, considering
> that only $foo is changed, not all *foo.

It is somewhat dangerous in my case, because I'd use it in an object
method that calls other methods of its class, some of which also do some
fooish stuff, and I'd like to avoid them being mixed up accidentally,
i.e. I'd like to make the methods as atomic and self-contained as
possible. Furthermore, using local makes the code a little confusing,
since we do not want at all to override a global variable here, but
only do it for better readability.

> You do need to come to grips with references, though,
> and eschew them not, for these ugly symbol table games
> will not always avail you.

Oh, I'm comfortable with refs :), but writing 

  sub x {
    my $foo = \$_[index-of-foo];
    <do stuff with $$foo here>
  }

instead of

  sub x {
    <do stuff with $_[index-of-foo]>
  }

seems not that much an improvement of readability and understandability
to me. :)

-- Niklas


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

Date: 12 Aug 1998 21:51:35 GMT
From: Niklas Matthies <matthies@fsinfo.cs.uni-sb.de>
Subject: Re: lexically scoped aliases
Message-Id: <6qt2p7$qcg$2@hades.rz.uni-sb.de>

In comp.lang.perl.misc, John Porter <jdporter@min.net> writes:
> Niklas Matthies wrote:
>> what one might expect that
>>   my *foo = \$bar;
>> would do if it were legal?
> 
> Your desires/expectations are as good as anyone's, 
> considering it's not legal.

That's why I said 'might', not 'does'. :)

>> E.g. I want to manipulate parameters passed to a subroutine directly
>> (without copying them or using references to them), but want to use
>> more descriptive names than @_ or $_[5]. Using 'local' would pollute
>> the symbol table, which I don't want to.
> 
> Guess you're out of luck.  What's wrong with using references?

Needless dereferencing going on where I only want better readable code.

> Also, if you use English; you can say @ARG and $ARG[5].  
> Does that help?

Nope, I'm referring to the @_ coming from subs' argument passing,
as I exlained above.

-- Niklas


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

Date: Thu, 13 Aug 1998 06:11:50 +0800
From: Steven Lai <o10382@email.mot.com>
Subject: make test error in compiling Perl under AIX 4.2.1
Message-Id: <35D21325.17CCF186@email.mot.com>

Hello,

I have a question concerning the compilation of Perl 5.004_04 under IBM
AIX 4.2.1.  I use gcc to compile the package.  Everything is going fine
before
I perform the 'make test' command.  When I make test, only about 83% of
the
test is ok.  The following are example of failed test.

pragma/locale.....FAILED at test 0
lib/anydbm........FAILED at test 0
lib/filecopy......FAILED at test 6
lib/filehand......FAILED at test 0
lib/io_sock.......FAILED at test 0
lib/io_taint......FAILED at test 0
lib/io_tell.......FAILED at test 0
lib/io_udp........FAILED at test 0
lib/io_xs.........FAILED at test 0
lib/ndbm..........FAILED at test 0
lib/odbm..........FAILED at test 0
lib/opcode........FAILED at test 0
lib/open2.........FAILED at test 0
lib/open3.........FAILED at test 0
lib/ops...........FAILED at test 0
lib/parsewords....ok
lib/posix.........FAILED at test 0
lib/safe1.........FAILED at test 0
lib/safe2.........FAILED at test 0
lib/sdbm..........FAILED at test 0
lib/searchdict....ok
lib/selectsaver...ok
lib/socket........FAILED at test 0

Have you experience similar problem ?  If so, please reply or send me
a email at o10382@email.mot.com.  Thank you very much.

Regards,

Steven Lai



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

Date: Wed, 12 Aug 1998 18:30:23 -0400
From: "J Nicholas Tolson" <jtnt@nospammindspring.com>
Subject: need help making WBT system
Message-Id: <6qt518$f6h$1@camel19.mindspring.com>

Hello all.

I have been put in charge of making a web-based training system for my
company. The system will contain many courses and many users/instructors
over an extended period of time.

The requirements are:

restricted password access (immediate and authorized access after
(self)creation of account)
only one person per UN:PW using system at any given time
student tracking (which courses have they taken, which they have not, which
courses they have access to (payed for), where they left off last time,
etc...)
time-limited access (e.g. user has 7 days to complete course or can access
course no more than say 5 times, etc...)
self-grading tests
personal splash screens for each user


I will be developing all the HTML pages and multimedia (shockwave, flash,
dhtml, etc...), but I need some help with the above server-side programming.
I have fooled around with cgi scripting before (tweaking message boards to
suit my needs, etc...) but cannot build this functionality from scratch.I
have also looked into pre-fab WBT systems such as TopClass and others, but
these contain a lot of junk that I don't want or don't have exactly what I
need. 

I am looking for both on-line resources (pre-built scripts for some things,
if possible) and, if necessary, programmers who can help me with development
of this system.

I appreciate any help anyone can offer on this. We are in the beginning
stages of researching this, and I hope someone can point me in the right
direction. Thanks.



Nicholas Tolson
Multimedia Producer/Programmer
Reply to nicholas@ealink.com (don't just hit reply)





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

Date: Wed, 12 Aug 1998 22:50:45 GMT
From: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: Opening a file as "+>>file"
Message-Id: <35d21b56.87178@news.demon.co.uk>

I read somewhere that if you open a file as follows:-

open HANDLE, "+>>file1" || do something on fail

the length of the record written back to the file MUST be the same
length as the original record length.

Is this true and could someone explain why?

Thanks

Phil


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

Date: 12 Aug 1998 21:00:25 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Perl 5.005.1 core dumps under Irix 6.2
Message-Id: <6qsvp9$dd2$1@info.uah.edu>

In article <yd8emumi32o.fsf@hoshi.engr.sgi.com>,
	Scott Henry <scotth@sgi.com> writes:
: >>>>> "O" == Oliver Laumann <net@informatik.uni-bremen.de> writes:
: 
: O> Has anybody managed to successfully compile Perl 5.005.1 under Irix
: O> 6.2 using cc -n32 (on an IP-22 machine)?
: 
: Most definitely. What compiler version are you using? Perl found
: some optimizer bugs in pre-7.2.1 compilers, one of them during the
: 5.005 alphas. The fix made it into the 7.2.1 compilers.. As long as
: you didn't override the hints file, which reduces optimization for
: the cases which were tested...

I wonder whether the optimization level shouldn't be turned down for
toke.c too.  cc -n32 -O3 toke.c ends up sucking in about 40 Mb
(according to gmemusage) and takes forever (v7.1 compiler, BTW).
Does this problem show up with later versions?

Greg
-- 
Two most common elements in the universe: Hydrogen & Stupidity.


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

Date: Wed, 12 Aug 1998 21:31:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl Newbie script error
Message-Id: <Pine.GSO.4.02.9808121429250.10161-100000@user2.teleport.com>

On Wed, 12 Aug 1998 akhtara@ishtartech.com wrote:

> Subject: Perl Newbie script error

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> When I try to run this script I get the following error messages:
> Can't locate auto/IO/Socket/INET/net.al in (@INC contains:

When you get a strange error message from perl, check the perldiag manpage
for an explanation. In this case, you should probably (have your system
administrator) install the module again. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 12 Aug 1998 15:48:53 -0700
From: Brian Tiemann <briant@packeteer.com>
Subject: print() acting strangely on Win32
Message-Id: <35D21BD5.DAD7FF1B@packeteer.com>

Hi-- I need some help here with print().

	I've got a perl application that runs great on Unix, but I need to port
it to Win32. What the application does is this: It uses Net::Telnet.pm
to connect to a remote HTTP server, issue a command, and retrieve the
data (a GIF image served by a CGI). Then it prints out the binary data
directly (into the browser).

	The problem: print() works just fine on Unix, printing out each
character as it comes in, without translation. However, on Win32, it
converts all the line-feed characters (0a) to CR/LF combinations (0d0a).
I don't want it to do that-- this is binary data that gets screwed up
easily. :)

	Perl script used to test:

#!/usr/local/bin/perl

open(FH, "> dump.log");
print FH "\012\015\015";
close(FH);

	The output under Unix, hexdumped:
0000000 0d0a 000d                              
0000003
	And the output under Windows:
0000000 0a0d 0d0d                              
0000004

	Reversing the byte order for readability, this shows that we've got the
following:

Unix:		0a0d0d0d
Windows:	0d0a0d0d0d

	So, that's my quandary. How do I make it not do that? Is there an
option to print() that suppresses this translation? Any assistance would
be greatly appreciated. :) Thanks!

Brian


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

Date: 12 Aug 1998 21:06:34 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: RE engine vs. Perl
Message-Id: <6qt04q$dl3$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Phoenix 
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.4.02.9808121309170.10161-100000@user2.teleport.com>:
> > I would think that this would be less efficient than [^\x00-\xff] or
> > (?!.) since \b must read two chararacters before it can decide whether
> > it is at a word boundary or not.

(?!.) will match at end-of-string and (without (?s)) before \n.

> > I'm doing character conversions on very large files so performance is
> > critical.
> 
> I have a hard time believing that the difference will be enough to notice
> on any real-world program, but you're welcome to prove me wrong! :-)

My conjecture would be that for moving the logic from Perl to the RE
engine the speedup up to a couple of orders of magnitude may be
expected.

Perl is *fantastically* slow in *dispatching* its primitives.  The only
things that allowed Tom and Randal to pretend that Perl is quick are

     a) Competitors are yet worse;
     b) For applications which just shuffle the info around (as opposed
	to creating new info) one can spend a lot of time *inside*
	Perl primitives, thus mask the slowness of the dispatcher.

And there is a very little hope to speed up the dispatcher
significantly.

On the other hand, RE engine provides a language-in-language: an
alternative dispatcher of alternative primitives.  As the dispatchers
go, RE engine is pretty quick.  Thus exiting RE engine as rare as
possible is the sure recipe for a speedup.

This is why I spent so much time speeding up and pumping up the RE
engine.  Good RE engine is the only hope in sight for a speedy Perl.

But I think this hope is at least a couple of revisions away.  5.007?

Ilya


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

Date: 12 Aug 1998 14:22:48 GMT
From: <alexk@alexk.appliedtheory.com>
Subject: Re: re first language
Message-Id: <6qs8fo$ifi$1@news.appliedtheory.com>

Steve Linberg <linberg@literacy.upenn.edu> wrote:
: In article <01bdc1f7$ad850220$47eb1bcc@XSTA71.pcr.com>, "Matt Heusser"
: <matt@pcr7.pcr.com> wrote:

:> Forget that.  When I was in college, I took a course
:> in VAX assembler, and we had to take our assembler
:> code and turn it into Hex or Octal.  REAL programmers
:> code in Octal.    ;-)  <Sarcasm clearly implied>

: REAL Real Programmers punch their own cards.  :)
: _____________________________________________________________________

REAL real real programmers change their own vaccuum tubes

: Steve Linberg                       National Center on Adult Literacy
: Systems Programmer &c.                     University of Pennsylvania
: linberg@literacy.upenn.edu              http://www.literacyonline.org

-- 

--
Alex Kamantauskas
Hostmaster, AppliedTheory
alexk@appliedtheory.com


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

Date: Wed, 12 Aug 1998 20:18:41 GMT
From: andreas.hack@duesseldorf.netsurf.de (Andreas Hack)
Subject: Re: Run perl script "in-line"?
Message-Id: <35d1f87b.6269144@linux>

On Wed, 12 Aug 1998 12:11:16 +0000, Adam Ipnarski
<adam@fastfare.co.uk> wrote:

>Lee Davies wrote:
>> 
>> Is there a neat way to run a perl script in-line in much the same way as
>> Javascript can be embedded?
>> 
>> I have a perl script which collects some server details (hostname, port, OS
>> version etc.) and want this information echoed into the current document.
>> This has to happen without user intervention.
>> 
>> Any suggestions?
>
>Not unless you write a Web browser to do that!
>
>Scripting Languages are run at the client (i.e. Browser) end, so it
>would mean having to build a Perl interpreter into the browser, and
>develop a cut-down form of Perl - PerlScript :-) to prevent access to
>local machine resources.
>
>--adam
>
>Adam Ipnarski
>Snior Programmer, Faresearch
>adam@fastfare.co.uk | www.travelselect.com


Lee,

do you want information about the web-server, or about the client?
Andreas Hack

andreas.hack@duesseldorf.netsurf.de


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

Date: 12 Aug 1998 18:35:15 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: rosso@rsn.hp.com
Subject: Re: Using 2 delim's causing problems?
Message-Id: <ww8dkc3w.fsf@mailhost.panix.com>

Sara Rosso <rosso@rsn.hp.com> writes:

> So obviously the ; is working and the | is not. Is there a problem with
> using | as a deliminator? Or is it another problem?

The | character has a special meaning in Perl regular expressions.
You'll find this documented in the manual that accompanies Perl, in
the document called "perlre".  To protect metacharacters such as |
from the regex engine, you'll want to use either the quotemeta
function (as documented in "perlfunc") or its double-quotish
equivalent, \Q\E, which are documented in "perlfaq6" and "perlop".

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Wed, 12 Aug 1998 13:55:13 -0700
From: "Dan S. Levine" <dslevine@flash.net>
Subject: Using PERL5 with NT4 Peer Web Services
Message-Id: <35D20131.BB64591@flash.net>

I can use PERL5/CGI on my service providers server with little problem,
mainly that I can not get debug information other than print statements
from the service provider.

Because of this I wanted to duplicate my code on a two computer intranet
using a cross over cable to two eithernet cards. Both pc's run NT 4.0. I
installed NT Peer Web Services (mainly to check this out, plan to
install the NT Server later) on what will be my server. I checked out
the hardware by sharing some files on the server and looking  at them on
both pcs. I was able to run a series of HTML to HTML scripts from the
client using the HTML files on the server. So far no problem. I
installed PERL5 and executed a script local on the serverand it worked.
I checked the register and the .pl was set up for PerlIS.dll. I set up
CGI for the same dll.

PROBLEM: When my link uses a .pl or .cgi script from the client to the
server i get the .pl file returned to me in NOTEPAD instead of
processing on the server and returning to me the scripts output. Any
body know what I did wrong ?

Thanks for any responses



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

Date: Wed, 12 Aug 1998 17:09:39 -0400
From: John Porter <jdporter@min.net>
Subject: Re: What is the purpose of Perl
Message-Id: <35D20493.1E80@min.net>

Peter Scott wrote:
> 
> Most people are content to bask in the background radiation of CPAN modules.

CPAN is, to my eye, amazingly structured and heterogeneous;
my rough calculations indicate that such things should not exist
for some time yet.  But there it is.

No doubt we'll find that the oldest bits of code in the perl core
are older than perl itself.

Based on the wide-ranging effects of perl programs on the net,
and on computers all over the world, we know that there are about 
10 times more perl programmers out there than the media would have 
us believe.
And since perl has closures, we can assume that there are actually
100 times more.

-- 
John Porter


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

Date: Wed, 12 Aug 1998 17:26:36 -0400
From: John Porter <jdporter@min.net>
Subject: Re: What is the purpose of Perl
Message-Id: <35D2088C.620C@min.net>

Mike Wescott wrote:
> 
> In a void context, begin with "Let there be light!" and 
> continue from there.

There is no 'let' statement in Perl.

Oh jeez:

12345678
     $ THERE = LIGHT
       CONTINUE

prodecure Context;
begin
    there := light;
    with there do
        continue;


Anyway, everybody knows the world begins with a #!.

-- 
John Porter


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

Date: Wed, 12 Aug 1998 21:49:14 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: What is the purpose of Perl
Message-Id: <6qt2qc$kje$1@ligarius.ultra.net>

[ posted and mailed ]

mike.wescott@columbiasc.ncr.com wrote:
-> In article <slrn6t14qn.q78.walkera@ofb.net> walkera@ofb.net (Walker Aumann)
->  writes:
-> 
-> > % perldoc perlfaq42
-> > ...
-> >     How do I create an exact duplicate of the universe?
-> > ...
-> 
-> In a void context, begin with "Let there be light!" and continue
-> from there. 
-> 
-> Works for me :-)

why stop there?

#!/usr/local/bin/perl -w
use strict;

print 'Let there be light';
my %Adam = ( 'rib' => 'wife');
my $Eve = $Adam{rib};
my $first_sin = "$Eve eating apple";
my %cities = ('Sodom'=>'&', 'Gomorah'=>'!');
delete $cities{'Sodom','Gomorah'};
my ($rain,@ark);
my @animals = qw( dove snake tiger lion bear snuffaluffagus );
map { push @ark,("$_ " x 2) } @animals;
for  (1..40) {     #days & nights
  print "rain";
}


Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-400-1972 
  Ext: 1949 and let the jerk that answers know 
  that his toll free number was sent as spam. "


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

Date: Wed, 12 Aug 1998 22:09:07 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: What is the purpose of Perl
Message-Id: <35d71263.60573509@nntpd.databasix.com>

On Wed, 12 Aug 1998 21:49:14 GMT, in article
<6qt2qc$kje$1@ligarius.ultra.net>, sowmaster@juicepigs.com (Bob Trieger)
wrote:

>[ posted and mailed ]
>
>mike.wescott@columbiasc.ncr.com wrote:
>-> In article <slrn6t14qn.q78.walkera@ofb.net> walkera@ofb.net (Walker Aumann)
>->  writes:
>-> 
>-> > % perldoc perlfaq42
>-> > ...
>-> >     How do I create an exact duplicate of the universe?
>-> > ...
>-> 
>-> In a void context, begin with "Let there be light!" and continue
>-> from there. 
>-> 
>-> Works for me :-)
>
>why stop there?
>
>#!/usr/local/bin/perl -w
>use strict;
>
>print 'Let there be light';
>my %Adam = ( 'rib' => 'wife');
>my $Eve = $Adam{rib};
>my $first_sin = "$Eve eating apple";
>my %cities = ('Sodom'=>'&', 'Gomorah'=>'!');
>delete $cities{'Sodom','Gomorah'};
>my ($rain,@ark);
>my @animals = qw( dove snake tiger lion bear snuffaluffagus );
>map { push @ark,("$_ " x 2) } @animals;
>for  (1..40) {     #days & nights
>  print "rain";
>}

What about the non-religious version:

print 'BANG';

-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 12 Aug 1998 22:18:26 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What is the purpose of Perl
Message-Id: <6qt4bi$8so$2@marina.cinenet.net>

Bob Trieger (sowmaster@juicepigs.com) wrote:
: why stop there?
: 
: #!/usr/local/bin/perl -w
: use strict;

Seems appropriate for the Old Testament. :)

: print 'Let there be light';
: my %Adam = ( 'rib' => 'wife');

No need to quote 'rib'.

: my $Eve = $Adam{rib};
: my $first_sin = "$Eve eating apple";
: my %cities = ('Sodom'=>'&', 'Gomorah'=>'!');
: delete $cities{'Sodom','Gomorah'};

And Sodom and Gomorrah are saved by the use of $ rather than @...I like
it!

: my ($rain,@ark);
: my @animals = qw( dove snake tiger lion bear snuffaluffagus );
: map { push @ark,("$_ " x 2) } @animals;

Yuck!  The Lord thy God *hates* map in a void context, especially when it
involves going out of one's way to avoid the more natural form:

  @ark = map { "$_ " x 2 } @animals;

: for  (1..40) {     #days & nights
:   print "rain";
: }

And from the New Testament:

  foreach (grep { ! /sin/ } @crowd) {
    throw($_, $stone[0]);
  }

and

  /^(\w+).*God/;

:)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 12 Aug 1998 22:51:05 GMT
From: peaceml@erols.nospam.com
Subject: Win NT Formmail and opening temporary files
Message-Id: <peaceml-1208981858390001@207-172-119-146.s146.tnt2.brd.erols.com>

Hello,

I sent this to the perl-win32-users@lyris.activestate.com, but got no
response so I thought I'd see if I can get any help on this newsgroup.

I'm kind of new at this so forgive me if I'm asking for something that
has been rehashed to death.  I'm using Matt Wright's formmail.pl file with
some modifications to make it work with softmail instead of Windmail.  I
can run this once with success.  However if I do not unlink the temporary
file nor manually delete the temporary file, I can not run again.  It just
hangs.  I have eliminated execution of softmail.exe so all the send_mail
portion of formmail.pl file does is create $tempfile and it still fails. 
I have limited the problem to the following line:

Open(MAIL,">$tempfile") || die ("Cannot open $tempfile - Check Directory
Permissions : $!");  

If the file already exists, the open appears to hang.  If I test for
existance of $tempfile and attempt to unlink it before the open, that also
hangs. The NT system I am using is using NTFS.  I've tried chmod, and
SetAttributes to no avail.  Do I have to set the file permissions in the
formmail.pl file using Win32::FileSecurity?  Any
answers/help/explainations/directions/etc. would be appreciated.

Thanks,

John


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

Date: 12 Aug 1998 20:46:33 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <6qsuv9$at3$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <6qsd9v$oda$1@client3.news.psi.net>:
> Really? I've posted several times the following from the fine documentation:
> 
>    A pattern matching the null string (not to be confused with
>    a null pattern C<//>, which is just one member of the set of patterns
>    matching a null string) will split the value of EXPR into separate
>    characters at each point it matches that way.

And each time I wonder why you do it again and again: this piece of
documentation is wrong (and misleading).

 >perl -le "@a = split /^|b|$/, 'abc'; print qq{,$_,} for @a"
 ,a,
 ,c,

Apparently, this piece of docs wants to tell us that 0-length matches
at start and end are ignored.

Ilya


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

Date: Wed, 12 Aug 1998 21:03:53 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <6qsvvp$jtl$1@nnrp1.dejanews.com>

In article <6qsd9v$oda$1@client3.news.psi.net>,
  abigail@fnx.com wrote:
> Patrick Timmins (ptimmins@netserv.unmc.edu) wrote on MDCCCVII September
> MCMXCIII in <URL: news:6qr68u$jts$1@nnrp1.dejanews.com>:
> ++
> ++
> ++ So I'm not saying I don't understand why it gives the elements it does.
> ++ I'm saying I don't understand why it doesn't work the way you (read 'I')
> ++ would guess it works, since there is nothing in the fine documentation to
> ++ otherwise "tip you off" to this silliness. :)
>
> Really? I've posted several times the following from the fine documentation:
>
>    A pattern matching the null string (not to be confused with
>    a null pattern C<//>, which is just one member of the set of patterns
>    matching a null string) will split the value of EXPR into separate
>    characters at each point it matches that way.
>
> It is certainly in the fine documentation.
>

My arguement is consistent with the above fine documentation. The
argument is over *when* does a parenthetical substring in a split
throw its' matching substring into the array? As specified in the
fine documentation a few lines down from your citing of the fine
documentation:

If the PATTERN contains parentheses, additional array elements are
created from each matching substring in the delimiter.

So I'm just arguing that this should follow common sense and
mathematical form. Since '(.*)' is enclosed in '(?=..)' and then in
the '/../' of split, it should be evaluated first [ the way '(1+3)'
is evaluated first in 'sqrt(4*(1+3))' ]. Just because you know
sqrt(0*(1+3)) is going to equal zero before you ever get to evaluating
the '(1+3)', doesn't mean that you should skip over evaluating the
'(1+3)', mathematically.

Logically, I would expect Perl to do this with split, and the first
element of the array should be the delimiter specified by '(.*)',
which would be the whole EXPR, if '(.*)' were, logically, the first thing
being evaluated.

Since Perl doesn't do this logical sort of thing (and maybe for good
reason, as pointed out by Dave Lorand), it confused me. Since this
little bit of straying from logic isn't mentioned in the fine
documentation, it makes seeing sigs in the ilk of

@arr =  split /(?=(.*))/s , "Just another Perl Hacker\n";
for (@arr) { print "$_"; }

doubly confusing, as I'm sure you'll agree! :)


Patrick Timmins
U. Nebraska Medical Center
--
perl -e 'print "Just another Logical Perl Hacker\n";'

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 3432
**************************************

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