[8562] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2179 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 25 12:07:23 1998

Date: Wed, 25 Mar 98 09:00:36 -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, 25 Mar 1998     Volume: 8 Number: 2179

Today's topics:
        2 tiny questions : 1. fork, 2. ctrl-c (__Olivier__)
    Re: Anybody experienced in File-Locking with Perl5? (Andrew M. Langmead)
    Re: Anybody experienced in File-Locking with Perl5? (Andrew M. Langmead)
        Can anyone help with a starting point nigel@hitcher.demon.co.uk
    Re: Can I delete the files directory? <fozz@mail.xmission.com>
    Re: Challenge your programming skill joshmccormack@yahoo.com
        Confused about directories 5.004_04 and perl5 vidals@truepath.com
    Re: Database vs. Flat-File Queue System <jdporter@min.net>
    Re: Delete Files via Unlink on NT?? Help! <jdf@pobox.com>
        get user information from the web <lzhu@emory.edu>
    Re: get user information from the web <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: hard reference, variable names ? <jdporter@min.net>
    Re: hard reference, variable names ? (Andrew M. Langmead)
    Re: html parser <jdporter@min.net>
    Re: looking for a piece of code <steve@prilnari.com>
    Re: NNTP and Perl <fozz@mail.xmission.com>
    Re: parsing perl <jdporter@min.net>
    Re: Perl Databases... <andrewf@cp.pathfinder.com>
    Re: Perl on Win95 - CMD32 - File Length Restriction ? <oesch@bluewin.ch>
        Perl versus Python benchmark-results <akuchlin@cnri.reston.va.us>
    Re: Perl versus Python benchmark-results <jdporter@min.net>
    Re: PerlRing??? <camerond@mail.uca.edu>
        Programmer Needed csalib@sitei.com
    Re: Ref to var in other sub? <delgreco@wco.com.anti-spam>
        revisiting "pod style comments revisited" kevin@cmhcsys.com
        Running several test clients <Kari.Marttila.@tietogroup.com>
    Re: trouble with \r (Tom Grydeland)
        Using strict and -d together (Jete Software Inc.)
    Re: Where to get Perl compiler for Win95 or Win NT? <wd@uebemc.siemens.de>
    Re: {block} orinted <FILE> descriptors (Andrew M. Langmead)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 25 Mar 1998 16:44:56 GMT
From: omueller@stud.ee.StoPx.ch (__Olivier__)
Subject: 2 tiny questions : 1. fork, 2. ctrl-c
Message-Id: <slrn6hicq7.g91.omueller@tardis-e3.ee.ethz.ch>

1. Does the fork funtion work with Perl Win32 ? (I have a linkchecker prog
that starts many processes : it works with Unix, but can it work with Win?).

(I got the message : The Unsuported function fork is unimplemented at ...)

2. Normally, if you press "Ctrl-C" or "Ctrl-Z" (we are on unix), the script
will be stoped/paused. How is it possible to make a scrit "unsensible"
to such keytrokes ? (i'm sure it's only a simple trick, but which one...?)

Merci !
Olivier


-- 
Olivier Mueller    |  omueller@stud.ee.SToPx.ch 
EE Student @ ETHZ  |  http://www.stud.ee.ethz.ch/~omueller
 ...Please replace "SToPx" by "Ethz" in my email to reply...


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

Date: Wed, 25 Mar 1998 16:24:19 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Anybody experienced in File-Locking with Perl5?
Message-Id: <EqDuwJ.3Kr@world.std.com>

Tobias Bugala <TobiasBugala@swol.de> writes:

>well I should lock a file so that only one process can access that file.
>I'm using HP-UX and I've written a testing code like this:
>Do you know where my fault is? I tested it by running the script two
>times in different windows and it prints the file in both of them...

Have you seen the "How can I lock a file?" entry in the FAQ?
<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq5/
How_can_I_lock_a_file_.html>

>$F_LOCK = 1;
>$F_ULOCK = 0;

It is very likely that these constants are wrong. (I don't know of any
systems that have numbers for these other than 2 and 8, but I wouldn't
put it past some vender to do so. Just take a look at what Sun did to
the sockeet constants.) You'd be much better off saying:

use Fcntl qw(:flock);

and using "LOCK_EX" "LOCK_UN" (but you really shouldn't use LOCK_UN,
see below.)

>flock FILE, $F_LOCK;

You should check the return code to determine whether your flock
succeeded. 


>flock FILE, $F_ULOCK;
>close (FILE);

Under almost all cases, you shouldn't unlock the file, the close()
will do it for you. One function of close() is to flush the data your
application has buffered to disk. If you unlock the file, you no
longer have the lock when the final write system call is done. Later
versions of perl help prevent this error by flushing the buffers
before unlocking, but you should probably avoid unlocking anyway.

You might also want to take a look at the flock entry in the perlfunc
man page:

<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfunc/flock.html>

-- 
Andrew Langmead


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

Date: Wed, 25 Mar 1998 16:29:17 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Anybody experienced in File-Locking with Perl5?
Message-Id: <EqDv4u.7BA@world.std.com>

sb@en.muc.de (Steffen Beyer) writes:

>Tobias Bugala <TobiasBugala@swol.de> wrote:

>> well I should lock a file so that only one process can access that file.

>Maybe the following code snippet will help you:

There are some drawbacks to this approach, as documented in the FAQ
entry: "Why can't I just open(FH, ">file.lock")?"

<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq5/
What_can_t_I_just_open_FH_fil.html>

The drawback is a race condition in which two processes might both
think they have the lock.
-- 
Andrew Langmead


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

Date: Wed, 25 Mar 1998 16:28:57 GMT
From: nigel@hitcher.demon.co.uk
Subject: Can anyone help with a starting point
Message-Id: <890843485.23320.0.nnrp-07.9e982442@news.demon.co.uk>

I've installed Perl for Win32, and Perl for ISAPI. I'm completely new to Perl 
and I'd be grateful if someone can give me a helping hand. I've setup a small 
HTML form but as I've no idea where to start with Perl when the form submits 
to the server the server returns:

'C:\InetPub\scripts\test.pl' script produced no output 

I'm familiar with the old INI file based transactions between the server and 
CGI applications but not with the methods  used for IIS and Perl for Win32.
If anyone could post me a simple Perl script that I could put behind the 
form that would generate a small HTML page it would be a start and really 
appreciated. Thanks.

Nigel

 


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

Date: Wed, 25 Mar 1998 08:13:06 -0700
From: "Doran L. Barton" <fozz@mail.xmission.com>
To: Bin Shen <bshen@transdynamics.com>
Subject: Re: Can I delete the files directory?
Message-Id: <35191F02.E43252EE@mail.xmission.com>

After you've done a 'make install', there's really no imperative reason
you have to keep the source files around.

-Fozz

Bin Shen wrote:

> It's pleasant to see perl5004 being compiled and installed gracefully.
> Then, can I remove the files extracted from the "latest.tar" without
> impair the functionality of perl? Thanks.
>
> Bin.



--
========================================================================
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"You're spending too much time online when you start referring to going
 to the bathroom as downloading."




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

Date: Wed, 25 Mar 1998 09:02:53 -0600
From: joshmccormack@yahoo.com
Subject: Re: Challenge your programming skill
Message-Id: <6fb66d$a1i$1@nnrp1.dejanews.com>

Not to go into excessive detail here, but actually the Zip code thing is much
worse in NYC. The World Trade Center, for example, has it's own zip code.
There are something like 15 of them in Manhattan alone.

Josh



In article <6f7c5m$no6@shell.clark.net>,
  hdiwan@shell.clark.net (Hasan Diwan) wrote:
>
> 	Residents living close together have the same zip code. New
> York's upper west side (where my uncle lives) is 10019, however world
> trade centre is 10023.
>
> abigail@fnx.com (Abigail) writes:
>
> >Bart Lateur (bart.mediamind@tornado.be) wrote on MDCLXIII September
> >MCMXCIII in <URL: news:351b9588.4775289@news.tornado.be>:
> >++ Abigail wrote:
> >++
> >++ >However, the human race,
> >++ >specially in "modern" countries has the habit of all crawling together
and
> >++ >live on each others lap. Clusters of humans are sometimes called
cities.
> >++ >
> >++ >If your customers are clustered, your approach doesn't work well.
> >++
> >++ Customers in the same city do tend to have the same ZIP-code, don't
> >++ they?
>
> >No.
>
> >Abigail
> >--
> >perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
> >           print+Just (), another (), Perl (), Hacker ();'
> --
> Hsiang Huang
> University of California at Berkeley
> Department of Electrical Engineering/Computer Science
> hasandiwan@mindless.b.com <--- anti-spam remove b. to reply
>


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 25 Mar 1998 10:23:50 -0600
From: vidals@truepath.com
Subject: Confused about directories 5.004_04 and perl5
Message-Id: <6fbato$ecp$1@nnrp1.dejanews.com>

Hi,

I've installed Perl 5.004 and I need help understanding why I have two
directories:

1) /usr/lib/perl5
2) /usr/lib/perl5.004_04/lib

Both of these seem to contain largely the same files. Do I need both
directories?  I just installed CGI.pm and found out that we're still running
the OLD version that resides in directory 2 above. I'm getting confused when
installing new software. I'm not sure which of the two directories above is
THE perl directory.

Thanks,
Gil

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 25 Mar 1998 10:21:20 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Database vs. Flat-File Queue System
Message-Id: <351920F0.27EF@min.net>

Steve Wells wrote:
> 
> I'm designing a queue system that has over 100,000 lines in it.  The
> system will run on UNIX machines and the data to perform the
> processing is retrieved from an SQL database.  Now we need a queuing
> system that is to be used to do the processing on separate machines.
> 
> Do we build a separate table in the database and read and remove lines
> from the database or do we use a flat file and read and remove lines
> from a flat file.

It seems to me that using a sybase table to implement a queue is
inefficient. (Do I get the understatement award?)

When you say 100,000 lines, do you mean 100k items in the queue?
Or are you simply saying that this is a large project?
A more-than-adequate queuing system can be written in far less
than 100k lines of perl.

If the queue is no larger than a few pages, keeping it in memory
will be nice and fast.  If it's larger, you can keep in on disk
-- I would recommend raw blocks (the way sybase does).  In any
case a circular buffer is faster than any kind of linked list
or perl-style array (which is really queue).

Of course, as I'm sure you are aware, this is not a perl question.
It's just that perl might be the best language to write your
implementation in...

hth,
John Porter


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

Date: 25 Mar 1998 11:34:34 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Delete Files via Unlink on NT?? Help!
Message-Id: <pvjahgpx.fsf@news.concentric.net>

"Mark Polakow" <mark@imp.net> writes:

> I'm really tryin to get this perl stuff...

One great resource that you shouldn't ignore in your efforts is the
book _Learning Perl_.  Do you have it yet?  If not you should buy it,
and read it from cover to cover, doing all of the exercises.

> opendir(MYDIR, "$root$dir")
> or die print "Unable to list the directory *$dir*, $!, check permissions.";

There are a couple of problems with this line.  If and when opendir
fails here, the program will exit with the message

   1 at myscript.pl line 13.

since the value of the print operator is '1' when successful.  You
want

   opendir(FOO,'foo') or die "Can't open foo: $!";

Also, don't assume that the problem lies in permissions; $! will tell
you what the problem is.  Finally, your error message should reflect
the *actual directory* you're attempting to open, which is
"$root$dir," not "$dir."

> print "file" if ( -f "$root$dir/$file");
> print "directory" if ( -d "$root$dir/$file " );
                                            ^
Why is that space there?  (Also, you don't need those parens.)

> This code returns a directory listing marking files and directories 

It shouldn't, since you never actually readdir.  Is this *really* the
code from your script?

> but it also returns those annoying dos dots (. and ..) in the
> listing

That's how the current and parent directories are spelled in many
operating systems.  A common idiom for excluding those entries from a
readdir is

   @files = grep { not /^\.\.?$/ } readdir FOO;

You should read the entry for grep in perlfunc.  Hope this helps.

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


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

Date: Wed, 25 Mar 1998 10:29:41 -0500
From: liang <lzhu@emory.edu>
Subject: get user information from the web
Message-Id: <351922E4.6479788F@emory.edu>

hello all,
    I am trying to use perl to get all the information possible from the
client side when he enters my web page. All I know is gethost() to get
his host information. But I knew there must be more, can anyone help me?

lzhu@emory.edu

thanks in advance.




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

Date: 25 Mar 1998 17:13:05 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: get user information from the web
Message-Id: <7x1zvq92b2.fsf@beavis.vcpc.univie.ac.at>

Re: get user information from the web, liang
<lzhu@emory.edu> said:

liang> hello all, I am trying to use perl to get all the
liang> information possible from the client side when he
liang> enters my web page. All I know is gethost() to get
liang> his host information. But I knew there must be more,
liang> can anyone help me?

use CGI;

    http://www-genome.wi.mit.edu/ftp/pub/software/WWW/

for more info.

hth

-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"Everything I am, I learned on the back of cereal boxes" ~ RJ, "Over the Hedge"


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

Date: Wed, 25 Mar 1998 09:59:54 -0500
From: John Porter <jdporter@min.net>
Subject: Re: hard reference, variable names ?
Message-Id: <35191BEA.3312@min.net>

Phil R Lawrence wrote:
> 
> In my program I said 'use strict vars' and declared %M, %F, and %T.  In the
> code snippet below, I want to add keys and values to these hashes.
> 
> The problem is with this line:
>    $sex{$offer} = $sth->fetchrow_array;
> 
> I want this to update %M and %F, depending on which value $sex is currently
> set to, but instead it tries to update %sex.  (Which causes the script to
> die, as I haven't declared %sex.)
> 
> How can I use a variable as the hash name, in the same manner that I use a
> variable for the hash key?

Why don't you use a "two-dimensional" hash?  Declare %offers instead of
%M and %F.  Then:

	$offers{'M'}{$offer} = [ $sth->fetchrow_array ];

	$offers{'F'}{$offer} = [ $sth->fetchrow_array ];

(If Benjamin is right, you'll need the square brackets to make an
anonymous array out of the array returned by fetchrow_array.)


> (I don't want to delete
> the 'use strict' line as I am a young programmer and understand it to
> protect me from dull-witted mistakes.)  

You have done well, glasshoppa.

John Porter


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

Date: Wed, 25 Mar 1998 16:32:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: hard reference, variable names ?
Message-Id: <EqDvAM.A5H@world.std.com>

"Phil R Lawrence" <prl2@lehigh.edu> writes:

>I want this to update %M and %F, depending on which value $sex is currently
>set to, but instead it tries to update %sex.  (Which causes the script to
>die, as I haven't declared %sex.)

How about if you set up another hash which have references to %M and
%F as elements:

my %hashes = (M => \%M, F => \%F);

and you can say "$hashes{$sex}" to get at the appropriate hash.

-- 
Andrew Langmead


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

Date: Wed, 25 Mar 1998 10:11:09 -0500
From: John Porter <jdporter@min.net>
Subject: Re: html parser
Message-Id: <35191E8D.5D14@min.net>

Rouslan Zenetl wrote:
> 
> actually, as it turns out, i was looking for an html-beautifier. so far with
> some help i found two. the bhtml and the Arachnophobia. both of them don't
> indent html. i also found couple of threads on the web discussing whether it
> is a good idea or not, but no real clues to what i need.

> > Rouslan Zenetl (rouslan@erols.com) wrote on MDCLXIV September MCMXCIII in
> > <URL: news:351484A9.5B266CA3@erols.com>:
> > ++ is there a perl-based html parser? or should i rather start looking
> > ++ towards python?

God forbid!


> Abigail wrote:
> 
> > use HTML::Parser;

The answer is still the same: use HTML::Parser.
When you've built the HTML tree (eased by the use of HTML::TreeBuilder),
you can then traverse it, and print each node indented by depth.

'Course, if you don't know perl, this is probably just mumbo jumbo to
you.

hth,
John Porter


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

Date: Wed, 25 Mar 1998 16:33:24 GMT
From: Steve Wells <steve@prilnari.com>
To: jamdiaz@klaskycsupo.com
Subject: Re: looking for a piece of code
Message-Id: <3519316D.D39E1451@prilnari.com>

Jamie Diaz wrote:
 
> I have a directory with a bunch of files with the name's of
> final-0146.sgi to final-0506.sgi in sequence.
> 
> I am trying to rename them to Z-bg.1.sgi to Z-bg-361.sgi..in sequence

ls ./final-*.sgi | perl -ple 'rename($_, "Z-bg.".$c++.".sgi")'

Switching them back would be a bit trickier...

STEVE

-------------
Steve Wells
http://www.iren.net/wellss


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

Date: Wed, 25 Mar 1998 08:35:50 -0700
From: "Doran L. Barton" <fozz@mail.xmission.com>
To: Didier LADNER <didier@referencement.net>
Subject: Re: NNTP and Perl
Message-Id: <35192456.1ED94150@mail.xmission.com>



Didier LADNER wrote:

> Hello, I have a problem that I can not solve because lack of a knowledge
> of the protocol nntp and the standard headers  of this protocol.
>
> I work for a network organization which exchange the cv and job offer
> over extranet.
> The cv are e.mailed by a simple routine to sendmail.
> Each cv emanating from one of the members of the group will be sent to a
> forum of new dedicated to job.
>
> Here the code:
>
> $mailprog = '/usr/lib/sendmail -oi -t';
> $addressee = 'myname@mydomainname.x';
>
> open (MAIL, "|$mailprog") || die "impossible1 $!\n";
> print MAIL "From: didier\@referencement.net\n";
> print MAIL "To: $addressee\n";
> print MAIL "Newsgroups: test\n";
> print MAIL "Subject: $subject\n";
> print MAIL "Reply-To: $sender\n";
> print MAIL "$mess\n";
> close (MAIL);

The problem here is that you're creating a pipe to sendmail - a program
which sends messages via SMTP (Simple Mail Transport Protocol). I suspect
you've been fooled by Pine's "Newsgroups: " pseudo-header and think that it
is a valid SMTP header. It's not. Pine makes separate NNTP connections if
you use that header.

So, to post a message to a newsgroup you should either check out some of the
stuff in the libnet module. Or, find a program that posts messages to NNTP
servers and works like sendmail at the shell prompt and open a pipe to it in
the same way.

-Fozz

--
========================================================================
Doran L. Barton = fozz@xmission.com && http://www.xmission.com/~fozz/;
"You're spending too much time online when you start referring to going
 to the bathroom as downloading."




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

Date: Wed, 25 Mar 1998 10:06:43 -0500
From: John Porter <jdporter@min.net>
Subject: Re: parsing perl
Message-Id: <35191D83.4CA9@min.net>

Phillip Lenhardt wrote:
> 
> Of course, it goes without saying that, "Nothing but perl can parse Perl"
> --although for some some reason they still bother to say it in the FAQ :)

The problem with that is that it implies either 1) perl will be the only
thing ever to be able to parse perl, or 2) anything else anyone writes
which can parse perl is also to be called perl -- even if it's a mere
text editor.

Wouldn't it be nice if someone (perhaps in the employ of O'Reilly?)
could squish the perl source through some kind of Software
Engineerifaction
filter, so that us mere mortal perl enthusiasts could do something with
it.  "Drop in an eiffel-generating backend? No problem!"  Just
dreaming...

John Porter


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

Date: Wed, 25 Mar 1998 11:06:08 -0500
From: "Andrew F. Lee" <andrewf@cp.pathfinder.com>
Subject: Re: Perl Databases...
Message-Id: <Pine.GSO.3.95.980325110240.25180A-100000@cp.pathfinder.com>

> Bill Lewis <Bill.Lewis@mci.com> wrote:
> 
> > Then in the script I assign keys and values like such:
> > 
> > %info = $key => $value;
> 
> $info{$key} = $value;
> 
 
%info = ($key => $value);

maybe it was a typo ....

-------------------------------------------------------------
Andrew F. Lee                 |                              |
Software Engineer             |  parenttime.com              |
email: andrewf@pathfinder.com |  1271 Avenue of the Americas |
Phone: (212) 522-2769         |  New York, N.Y. 10020        |
-------------------------------------------------------------
        When I say, "Ignore the man behind the curtain."   
        That is because there is no man behind the curtain.



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

Date: Wed, 25 Mar 1998 15:51:50 +0100
From: philippe <oesch@bluewin.ch>
Subject: Re: Perl on Win95 - CMD32 - File Length Restriction ?
Message-Id: <35191A06.E2F7AE68@bluewin.ch>

just how do i configure command.com on winnt 4.03 to accept ctrl-z as
the eof marker, anyways? while being in perl typing ctrl-z just prints
to the screen and does ***not*** shove my script in the interpreter...

what am i missing?

scott@softbase.com wrote:
> 
> The first Ctrl-Z, and the thing exited like it had hit EOF!

-- 
Philippe Oesch, Dipl. Ing. ETH
pgp fingerprint: AE50 1CE7 FE17 CEF6 D000  387E 6BC9 0549 6F29 3ADC

_offtopic, again!


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

Date: Wed, 25 Mar 1998 14:55:18 GMT
From: Andrew Kuchling <akuchlin@cnri.reston.va.us>
Subject: Perl versus Python benchmark-results
Message-Id: <199803251455.JAA07118@newcnri.cnri.reston.va.us>

>I tried to run a regex-test for perl and python.
>Here's the result as a uuencoded tgz-file:

	To quote Crow T. Robot from _Cave Dwellers_: "Ah, something
dull."  It's nothing personal, Thomas, but such benchmark threads make
me scream.  Gather 'round, people; this is as close to flaming as I
get.

	I can just sketch out the rest of this thread now: First a
bunch of people will make tweaky little changes to both versions of
the benchmark code to improve it; these changes will of course be
derived from deep knowledge of the implementations and regex engines,
and result in code completely incomprehensible to non-users of the
respective languages.  Then we'll all have a nice toasty flamewar
about the results, and about just how useful regexes are, and about
clarity-vs-speed, and that'll keep us going on nastily into May.

	In addition, the test chosen is uninteresting because it's
just using a single, very simple class of pattern: alternating fixed
strings.  Is this a commonly-used regex pattern?  What about .*?  What
about (x)+?  What about backreferences?  It would be far more useful
to construct a regex benchmark suite representing typical usage (what
*is* typical usage, anyway?), run it through PCRE and profile it, find
where the code bottlenecks are, and *fix* them.  (Plus, that would
benefit users of other programs that use PCRE, such as exim and tin;
greatest good for the greatest number...)

	I haven't gotten around to this work yet, and won't bother to
do so for a while, because IMHO Unicode support is a more important
issue.  More people care about it than regexes, potentially.  There's
an interesting and relatively simple proposal for adding Unicode
support to Python, just waiting to be implemented by someone.  And
optimizing PCRE before changing it to support Unicode is a bad idea.

	In short, benchmarks are only useful if someone is able to use
them to point out problem areas, as on the linux-kernel mailing list
where people often say things like "The context-switch time seem a bit
slow; here's a patch that shaves 10 cycles off it".  Otherwise, I
really couldn't care less if Perl is faster than Python or vice versa.


A.M. Kuchling			http://starship.skyport.net/crew/amk/
And forewarned is seldom forearmed. Not even in the shifting zones.
	-- Dream, in SANDMAN: "Soft Places"


	


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

Date: Wed, 25 Mar 1998 10:33:38 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Perl versus Python benchmark-results
Message-Id: <351923D2.57F8@min.net>

Thomas Ackermann wrote:
> 
> I tried to run a regex-test for perl and python.

Somehow, regexes consisting of short, plain strings
hardly test the language's regex engine.  Who has
the faster index()?

Let's throw some whoppers at these guys.  Regexes
which are recognized by egrep, but not by the
regex() function(s) available in the C library.
Does python do anything other than calls to the
C regex()?

John Porter


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

Date: Wed, 25 Mar 1998 09:16:21 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
To: MARTIN@RADIOGAGA.HARZ.DE
Subject: Re: PerlRing???
Message-Id: <35191FC5.EE1E2E60@mail.uca.edu>

[cc'd to mv]

Martin Vorlaender wrote:
> [snip]
> On every non-Unix platform I installed Perl on the "system" perl scripts were made into shell scripts by prepending them with some lines (to call perl from the shell) and naming them accordingly (i.e. .bat on Win32, .cmd on OS/2, .com on VMS). So I assume there is perldoc(1) on non-Unix machines (proof by empirical observation). It's just that command lines aren't very popular with those WIMP (Windows, Icons, Menus, Pulldowns) interfaces.
> 

Come on, now, on Win95, you just type:

C:\> perl script.pl

and it runs fine, no .bat needed. And, as to the perldoc, just:

C:\> perldoc perlfunc

and viola (yes, the violin's big brother for those who think I can't
spell) up comes the pod, paginated even. Although, I really do like the
HTML docs, just spoiled, I guess.

Cameron
camerond@mail.uca.edu


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

Date: Wed, 25 Mar 1998 09:42:59 -0600
From: csalib@sitei.com
Subject: Programmer Needed
Message-Id: <6fb8hq$c7m$1@nnrp1.dejanews.com>

Hello,
I am working on a nonprofit organization's web site. They have assembled a web
committee to work on this project, creating content, etc. Unfortunately, most
of them are not technically minded so teaching them HTML would be quite a
task.

I do not have the skills to customize these scripts, if there is someone who
could help me in this, I would appreciate it. I am not sure what kind of
payment we would be able to give you, but please let me know if you are
interested in working on this and what you would require.

This script will hopefully remove the need to have the content developers
learn HTML and simplify the publishing process tremendously. Please refer
to the following web site as an example of the interface:

http://www.sitei.com/staff/christine/nacopt/church/example.html

It is definitely not refined enough but it gives a general idea of what I am
looking to do.

Refer to this page to see the proposed end result:

http://www.sitei.com/staff/christine/nacopt/church/article.html

The fields on the web page would be inserted into a specified template through
a script. The result would be a new file - a completed web page. Here are the
specifications as to how this is supposed to work.

There will be different web pages for each of the sections within the site.
For the purpose of this spec, I will deal with the Churches section of the web
site which includes subsections on Church Life, Church History, Saints, etc.

The user would be working from a computer in the Diocese. The web page
generator relies on having access to the Diocese's server. Pages will
not be published directly to the web, but to the server at the Diocese. After
the final approval process, the webmaster will publish the site directly to
the web.

1. User is stationed at a computer in the Diocese computer lab, all
computers are networked to the local server. User opens web browser and
enters the URL for the Churches Web Page Generator and is prompted by a
dialog box to enter
login and password.

2. After submitting correct login/password, the web page generator
appears.

3. User enters text in Author field.

3. User enters text in  Article Title field.

4. User selects appropriate subsection from the pull down text field.
User pastes in their prewritten article.

5. User moves on to the options for the sidebar: "Find out More,"
"Related Info," "Glossary" and "Bible Verses."

6. User selects type of media from the "Find out more" pull down menu.

7. User presses "Browse" button and dialog box appears. User navigates
to the pages they would like linked and selects them. User presses ok
and dialog box dissapears. User presses attach and the page is added to
the textbox on the
right. User repeats if necessary.

8. User repeats similar process for next three sections, "Related
Topics," "Glossary," and "Bible Verses."

9. User pastes in any other optional text.

10. User presses "Create New Article" button.

11. Fields are submitted.
        ** If the fields "Author," "Article Title" and "Article" are
blank, then the user is prompted to use their back button to return to
the page and fill in the fields.

12. Script identifies what section within Churches was called and uses
that template.

13. Script creates and names new file.

14. Script begins writing template HTML into the file.

15. "Author," "Article Title" are placed in appropriate places in the
file.

16. Script writes in the article content, recognizing basic HTML (bold,
italics) and inserts paragraph tags on blank lines.

17. Script begins writing sidebar.

18. Script inserts appropriate graphic according to "Type" field.

19. Script creates anchor tag according to file path, and creates link
text according to the attachments <TITLE> tag.

20. Script repeats for all attachments in each of the four sidebar
sections.

21. Script inserts any "Optional Text."

22. Script completes writing template page and displays it as a preview.

23. User checks over content for errors and if the page is acceptable
clicks on the "Publish" button at the bottom of the page. If the page
has errors, the user presses the back button to make their corrections
and submits the page
again.

24. After pressing "Publish" a thank you page appears with the URL for
the new file.

If you are interested in this project, please reply to: csalib@sitei.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 25 Mar 1998 08:33:14 -0800
From: Dave DelGreco <delgreco@wco.com.anti-spam>
Subject: Re: Ref to var in other sub?
Message-Id: <351931CA.62AFB7AF@wco.com.anti-spam>

Okay, so after looking at Chapter 2 *again*...  :^)

That was just a typo.  Had I actually written that in my script, at
least 
Perl would have caught it (I think).  It leaves attendance to a lack of 
understanding of basic language features as an excercise for the
programmer.

Stuart McDow wrote:
> 
> David DelGreco <david_delgreco@intuit.com> writes:
> > I took another look at Chapter 2 of the Camel book and now realize that I
> > can "use strict" and still declare a global hash with "use qw(%config)".
> > Thanks to everyone who replied.
> 
> Um, that should be 'use vars qw( %config );'
> 
> I hope that's what you meant.
> 

-- 

Dave DelGreco    <david_delgreco@intuit.com.anti-spam>
Remove the anti-spam brackets to send return mail.


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

Date: Wed, 25 Mar 1998 09:42:22 -0600
From: kevin@cmhcsys.com
Subject: revisiting "pod style comments revisited"
Message-Id: <6fb8g0$bt1$1@nnrp1.dejanews.com>

hi,

i've got a problem with podding.  when i run pod2html on a particular
document, the pod parts only get converted up to some point in the document. 
this is the first time i've tried interspersing pod with code, rather than
putting all of the pod at the beginning or end of the file, so i wonder if
i've violated the following (quoted from tom, who cites perlsyn:


<begin quote>
man perlsyn:

   Perl has a mechanism for intermixing documentation with source code.
   While it's expecting the beginning of a new statement, if the compiler
   encounters a line that begins with an equal sign and a word, like this

Notice the "expecting new statement" part.
<end quote>

my problem is, i don't know what "expecting new statement" means.  does it
mean that, e.g., i CAN'T put pod in the middle of a subroutine definition or
a WHILE loop?  does it mean that i must ONLY put pod in the middle of a
subroutine definition or a while loop?

thanks,

kevin "i didn't know what DEPRECATED means, either" cohen

--- If we suppose for the moment that a pizza is a syntactical structue...
--Nigel Chapman

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 25 Mar 1998 18:19:38 +0200
From: Kari Marttila <Kari.Marttila.@tietogroup.com>
Subject: Running several test clients
Message-Id: <35192E9A.15C1@tietogroup.com>

Hi

I am wondering, if somebody knows how to launch several test clients in
a perl module. I am trying something like this:

testclient.pl:
##############################################################
$cnt = $ARGV[0];

die "Usage: testclient <number>\n" if (($cnt =~ /\D/) or ($cnt =~
/^$/));
for ($i = 0; $i < $cnt; $i++) {
#	system ("start /B Client1");
	exec ("start Client1 /B");
}
##############################################################

The idea is that I want to say "perl testclient 100" and this perl
script would create 100 test clients running concurrently in my NT 4.0.
I am not sure if this is possible in NT. Neither system or exec seems to
be working in NT.

It is possible to make a bat file like this though:
testclient.bat:
**************************
start /B client1
start /B client1
start /B client1
start /B client1
 ...
**************************
And test clients will run concurrently in NT.

If somebody sends a replay I would be very pleased to have a personal
reply also.

Thanks!

*******************************************************
Kari
Marttila                                                                           
TT Tieto / TT Government Services / Networking services 
Internet: Kari.Marttila@tietogroup.com
*******************************************************


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

Date: 25 Mar 1998 16:03:31 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: trouble with \r
Message-Id: <slrn6hiamj.oc3.Tom.Grydeland@mitra.phys.uit.no>

On 24 Mar 1998 13:52:13 +0100,
Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:

> You are assuming that STDOUT is the currently selected
> filehandle when you set $| - this may not always be true and
> thus $| isn't simply re-usable.

select((select STDOUT, $|++)[0]);

> Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: 25 Mar 1998 10:21:22 -0500
From: jete@dgs.dgsys.com (Jete Software Inc.)
Subject: Using strict and -d together
Message-Id: <6fb7di$d8v@dgs.dgsys.com>

I am running perl 5.003

When I attemt to run my perl program with the following lines

#!/usr/local/bin/perl -d

use strict;

I get the following error message:

Undefined subroutine &Carp::longmess called at /usr/local/src/perl-5.003/lib/per
l5db.pl line 1361.

What module do I need to include to get rid of it and why ??
Either turning off the debug option (-d)  or commenting out the "use
strict" line causes this error message to disappear

thanks!!

-- Norman


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

Date: 25 Mar 1998 15:18:04 GMT
From: Wolfgang Denk <wd@uebemc.siemens.de>
Subject: Re: Where to get Perl compiler for Win95 or Win NT?
Message-Id: <6fb77c$n1f$1@galaxy.mchh.siemens.de>

Randal Schwartz <merlyn@stonehenge.com> writes:

>QED  EIEIO.

EIEIO?
Enforce In-Order Execution of I/O? The PowerPC memory synchronization
instruction?

Wolfgang Denk

Office:  (+49)-89-722-27328, Fax -36703  Wolfgang.Denk@oen.siemens.de
Private: (+49)-89-95720-110, Fax -112                  wd@denx.muc.de
Only in our dreams we are free. The rest of the time we neeed  wages.
                                    - Terry Pratchett, _Wyrd Sisters_


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

Date: Wed, 25 Mar 1998 16:35:13 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: {block} orinted <FILE> descriptors
Message-Id: <EqDvEp.C8o@world.std.com>

jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni) writes:

>How can i make a rutine recursive structure so that i can use different
>file in diffrent step. I have only  found an (ugly?) workaround.
>The filedescriptors seem to default global and I can't change it.

Indirect filehandles need to be package globals, not my()d
variables. local($a) will work, where my($a) will not.

You are probably better off using the IO::File module to create
scalars that can be used as filehandles.
-- 
Andrew Langmead


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

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

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