[6576] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 201 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 29 14:14:51 1997

Date: Sat, 29 Mar 97 11:00:32 -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           Sat, 29 Mar 1997     Volume: 8 Number: 201

Today's topics:
     Re: 'flock' equivelent for NT (Geoffrey Hebert)
     Re: Concurrency Issues. (Geoffrey Hebert)
     Cookie Message Board <questions@cookiecentral.com>
     Re: CORRECT Re: perl5 string splitting question (David Alan Black)
     Re: Email forger Works for MindSpring <kibo@dhp.com>
     How to set up Perl on MS Frontpage97 <danroch@geocities.com>
     mkdir (Geoffrey Hebert)
     Multi-Million Connect Server (Steve Hindle)
     Re: Numeric / bitwise 'and' problem (Andrew M. Langmead)
     Ok, what do I need and where can i get it ?? <Lo.Tech@mailbox.swipnet.se>
     Re: Ok, what do I need and where can i get it ?? (Nathan V. Patwardhan)
     Re: Ok, what do I need and where can i get it ?? <eric@nettown.com>
     Re: passing variables using SSI problem <dbenhur@egames.com>
     Re: Perl hourly fees? (Clay Irving)
     Re: Perl mishandles some multidimensional array referen (Patrick Duff)
     Re: perl5 string splitting question (Andrew M. Langmead)
     Re: perl: can't handle large lists? (Geoffrey Hebert)
     Re: Question on bit-wise and operator <dbenhur@egames.com>
     Re: Question on bit-wise and operator <tchrist@mox.perl.com>
     running .pl with perl.exe ERROR help! (Lou Lanaro)
     Re: Sending Environment variables to a PERL script usin <basvreek@channels.nl>
     Server/Server & Client/Server <jaime@thepentagon.com>
     Re: Server/Server & Client/Server (Nathan V. Patwardhan)
     Re: Smarter indexing algorythm (M.J.T. Guy)
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: Wrapping text in perl (Geoffrey Hebert)
     Re: Wrapping text in perl (Geoffrey Hebert)
     Re: Wrapping text in perl (Geoffrey Hebert)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 29 Mar 1997 16:53:31 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: 'flock' equivelent for NT
Message-Id: <5hjgg8$3g1$1@news3.microserve.net>

Here is something I use:
Concept is to use a tempory file indicating that the file is in use.

 if (-e "file.lock") {  # is the file in use
          sleep 1;   # do anything if busy
 }  

open (LOCKFILE,">file.lock"); # file is now busy
open (DATAFILE,">data.tx");  # now use the data file

after close of DATAFILE remember to unline LOCKFILE.





Jan Pokorny <pokorny@svkhk.cz> wrote:

>hello,
>i'm a perl beginer and i am using it for cgi in netscape enterprise
>server for windows nt. it doesn't support 'flock' command. could anybody
>advise me how to sunstitute this command for nt envieroment?
>thank you in advance,
>jan 	pokorny@svkhk.cz




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

Date: Sat, 29 Mar 1997 16:57:08 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Concurrency Issues.
Message-Id: <5hjgn1$3g1$2@news3.microserve.net>

Your solution is a good one.  By doing a rename the there should be no
interuption.  If you rename whild someone is reading, they should
complete reading.

vanandel@intergate.bc.ca (Fred Van Andel) wrote:

>How do I create perl code that will allow for simultanous reading and
>writing of files by 2 different processes. Ie. I want to use perl to
>create *.htm files, but I have no control of when the web server will
>try to read those files.  Simply locking the files before writing will
>mean that the server will fail in its attempted read and send an error
>message back to the user and I dont want that. Do I write to a
>temperary file and do a rename to minimize the length of time that the
>file is unavailable or is there a better way?

>Thank you
>Fred Van Andel




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

Date: Sat, 29 Mar 1997 11:38:04 +0000
From: Andrew Pitt <questions@cookiecentral.com>
Subject: Cookie Message Board
Message-Id: <333CFF1C.5392@cookiecentral.com>

Hi,

There is a new persistent cookie Board, follow the link from
http://www.cookiecentral.com/faq.htm
-- 
-- 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cookie Central
http://www.cookiecentral.com
questions@cookiecentral.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




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

Date: 29 Mar 1997 17:14:35 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: CORRECT Re: perl5 string splitting question
Message-Id: <5hjilr$a9t@pirate.shu.edu>

Hello -

Eric Poindexter <eric@nettown.com> writes:

>Pat Lashley wrote:
>> 
>> Hi,
>> 
>> I've got a question for the wizards: What is the BEST
>> way to split a string into equal-sized chunks?  (The
>> chunk size is known a-priori; but the number of chunks
>> in the string is not.)

>Did you try something like this?

>!/usr/bin/perl

>$string = '123456789_123456789';
>$chunkSize = 4;

>for (split /(.{$chunkSize}?)/, $string) {
>  next unless $_;
>  push @result, $_;
>}

>$" = "\n";
>print "@result\n";

>Program output...
>1234
>5678
>9_12
>3456
>789

Or even:

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

$string = '123456789_123456789';
$chunksize = 4;

print join "\n", grep /./, split /(.{$chunksize})/, $string;


(Go ahead, Randal.  Make my day. :-)

David Black
dblack@icarus.shu.edu


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

Date: 29 Mar 1997 15:21:09 GMT
From: the one and only real true kibo <kibo@dhp.com>
Subject: Re: Email forger Works for MindSpring
Message-Id: <5hjc15$1sk@stronghold.dhp.com>

-----BEGIN PGP SIGNED MESSAGE-----

On Thu, 27 Mar 1997 20:42:31 -0500 in article <333B2207.1FDB@chrysler.com> posted to news.admin.censorship, Kevin Darcy <kcd@chrysler.com> wrote:
> the one and only real true kibo wrote:


>   > HUMANS. Deceiving programs is not illegal -- if it were, I  know a

>   > helluva lot of sysadmins who would be in the slammer right now
>   :-)

>   Big fucking deal - lots of people know Randall Schwartz.

> Care to address my point?

Yes - Randall Schwartz, a former sysadmincontractor at Intel, served
time in a slammer for the kind of shit you're  talking about.

Chris Lewis is next.  I'm going to Canada now to kick his fucking ass.


I am the only true <A HREF="http://www.dhp.com/~kibo">Kibo</A>.
Finger me for my PGP public key. Check out my home page for the coolest
way to vote on new newsgroup proposals or to issue Usenet cancels.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMz0zYalPvImbzLKZAQGLKQQAoCRZZ82g+3uGgck3hVi+igpg7GMfKJb8
VISQHyTtSKFhedYvkesSX6rrEHAwmPv42g1RyypynuBPQIPe6pbMEEXQ7KKYXGGD
bF0FAm5dyVvsMLBdJDDXa/w7UHH4tmoYUKwxK1Z9vAOEpXoZpOIJy73LdPyAGLVx
7h71JqxMQ6k=
=+gok
-----END PGP SIGNATURE-----


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

Date: Sat, 29 Mar 1997 13:30:12 -0500
From: Da Man <danroch@geocities.com>
Subject: How to set up Perl on MS Frontpage97
Message-Id: <333D5FB3.37B3@geocities.com>

Can someone help me? I am a beginning Perl programmer. Could someone
please tell me how to set up Perl on a frontpage server and if there is
something I need to put into each of my programs. Please??????

Dan



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

Date: Sat, 29 Mar 1997 18:51:04 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: mkdir
Message-Id: <5hjncj$4sa$1@news3.microserve.net>

I wanted to mkdir xx/yyy 0777
I would like to code to work on multiple OS's.
And I want to be able to do it from web.

Sounds impossible, is it?

I have tried several tests so far, with no success.

Thanks in advance.



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

Date: 29 Mar 1997 15:30:25 GMT
From: shindle@mail.goodnet.com (Steve Hindle)
Subject: Multi-Million Connect Server
Message-Id: <5hjcih$i18$1@news.goodnet.com>

Hi all

  I recently began working on a project expected to handle millions of
socket connections a day.  (I'm shooting for 256 connections/sec - being
an 8 bit kinda guy :) )  Anyway..Here are some ramblings based on my
current work.. I just managed to outstrip my testing program - so I think
its going pretty well. :) :)

1.) Poll 
  Yeah - its old fashioned, but a nice simple busy loop works great.  The
return codes from sysread & the buffer contents will indicate when a
disconnect occurs - select misses transitions and interrupts dont tell ya
which port to check.

2.) Pre-declare the Filehandles & stack them 
  I dup a set of FH's to STDIN and throw them on a stack - accept closes
  the previous FD's for ya :)

3.) Dont close() - accept calls do_close for ya :)

4.) WHERE the ##@# is using GLOBS in xsubs documented ??

5.) shift & unshift appear to be slightly faster than push & pop but
    shift and push seem to be slower than either pair - I think because
    of the MARK thing - I'm going to try shift and @array[#$array +1] =
    when I have time

6.) stack Filehandles available waiting for I/O. Read it and restack it
    if its not completed - if its completed, throw the FH on the
    available stack.

7.) Arrggh - solaris select(undef,undef,undef,.002) gives a 2 HUNDRETHS
    timeout :( - that cost me some hair :)

  Any comments are appreciated - will update when I get closer to full
  production.

 
  Thanx all 
  Steve Hindle

  "Theres more than 1 way to do it" - Rev. Baker to Tammy Faye




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

Date: Sat, 29 Mar 1997 13:53:32 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Numeric / bitwise 'and' problem
Message-Id: <E7t599.6up@world.std.com>

stirra@wwc.edu writes:

>The sysread
>function seems to be automatically converting the byte to a
>string or character context, so that '&' (bitwise and) doesn't
>do the correct thing:
>
>	sysread(S_IN, $rdbyte, 1);
>	$rdtest = $rdbyte & 0x0f;
>
>	last if ($rdtest == 0x0d);

sysread is reading characters from the terminal device. That means
when a control-D comes in, it is stored as the same things as the
string "\cD", not as "4". (Which is great, because when I type in an
"H", I want it to be an "H", not a "72".)

Either use ord() to get the numeric value associated with a character,
or change your tests to be comparing strings.

        $rdtest = ord $rdbyte & 0x0f; # the ascii value for the char in $rdbyte
        last if $rdtest == 0x0d;
or

        $rdtest = $rdbyte & "\x0f"; # stringwise-bitwise AND;
        last if $rdtest cmp "\cD";


Most likely the first one.

-- 
Andrew Langmead


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

Date: Sat, 29 Mar 1997 14:28:11 +0100
From: Johannes Hansson <Lo.Tech@mailbox.swipnet.se>
Subject: Ok, what do I need and where can i get it ??
Message-Id: <333D18EA.6369@mailbox.swipnet.se>

Hey you!...

Ok, I feel like I wanna get started to learn how to program
CGI-Scripts..
Or Pearl ?!.. Ehh..
Any diference??..

Anyone know any good page to learn from the begining how
to get started...
I know some C++.. And I have Visual C++...

What else do I need to get started and where can I get it..
(I prefer to get it for free!.. *grin*)..

Thanx for your time..

-- 
~^(^~ Gizmo, Lo-Tech WebCreation ~^(^~

^~ The Party Page...: http://home1.swipnet.se/~w-10357/
^~ 100% My Page.....: http://www.geocities.com/TheTropics/3035/
^~ PowWow...........: Gizmo@LoTech-WebCreation
^~ ICQ..............: 201152
^~ E-Mail...........: Lo.Tech@mailbox.swipnet.se
^~ E-Mail Work......: Johannes.Hansson@Attention.se
^~ E-Mail Work (BBS): SysOp@Attention.se
----


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

Date: 29 Mar 1997 15:51:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Ok, what do I need and where can i get it ??
Message-Id: <5hjdpr$j15@fridge-nf0.shore.net>

Johannes Hansson (Lo.Tech@mailbox.swipnet.se) wrote:
: Hey you!...

Ahh, an interlude by Pink Floyd.  :-)

: Ok, I feel like I wanna get started to learn how to program CGI-Scripts..

Ok, but you may want to roll over and go back to sleep until the feeling
goes away.  :-)

: Or Pearl ?!.. Ehh..
: Any diference??..

Perl ne 'CGI', and Perl != CGI.  I'd strongly suggest looking at the
book reviews at http://www.perl.com/perl, and looking around at your
local bookstore for CGI Programming (on the WWW) by Shishir Gundavaram,
or if you're going to use Windows, try _CGI Primer Plus for Windows_
published by Waite Group Press.

: I know some C++.. And I have Visual C++...

Might be helpful to you later on down the road.

: What else do I need to get started and where can I get it..
: (I prefer to get it for free!.. *grin*)..

You need a webserver, for starters, you might do a yahoo search for www and
server.  I suspect you'll find what you're looking for there.  :-)

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Sat, 29 Mar 1997 11:50:41 +0000
From: Eric Poindexter <eric@nettown.com>
To: lo.tech@mailbox.swipnet.se
Subject: Re: Ok, what do I need and where can i get it ??
Message-Id: <333D0211.6ABED8B1@nettown.com>

Johannes Hansson wrote:
> 
> Hey you!...
> 
> Ok, I feel like I wanna get started to learn how to program
> CGI-Scripts..
> Or Pearl ?!.. Ehh..
> Any diference??..
> 
> Anyone know any good page to learn from the begining how
> to get started...
> I know some C++.. And I have Visual C++...
> 
> What else do I need to get started and where can I get it..
> (I prefer to get it for free!.. *grin*)..
> 
> Thanx for your time..
> 
> --
> ~^(^~ Gizmo, Lo-Tech WebCreation ~^(^~
> 
> ^~ The Party Page...: http://home1.swipnet.se/~w-10357/
> ^~ 100% My Page.....: http://www.geocities.com/TheTropics/3035/
> ^~ PowWow...........: Gizmo@LoTech-WebCreation
> ^~ ICQ..............: 201152
> ^~ E-Mail...........: Lo.Tech@mailbox.swipnet.se
> ^~ E-Mail Work......: Johannes.Hansson@Attention.se
> ^~ E-Mail Work (BBS): SysOp@Attention.se
> ----

posted and emailed.

The CGI (Common Gateway Interface) is a protocol a web server uses to
run a program and give the program some "web" information. It terms this
program a Gateway. 

"The Common Gateway Interface (CGI) is a standard for interfacing
external applications with information servers, such as HTTP or Web
servers."
--opening sentence http://hoohoo.ncsa.uiuc.edu/cgi/intro.html

Also see http://www.w3.org/pub/WWW/CGI/Overview.html

Now, I love Perl, but the Only reason *I* got started in Perl is becuase
it's popular for web programming. Currently I try to use perl for
everything (esp. thanks to the compiler...
http://nettown.com/perl/compiler), but sometimes must program in C++.

Most any programming language (including C and C++) can interface to a
web server thru the CGI.

Also see:
http://nettown.com/perl/eg/
http://nettown.com/perl/site_perl/

--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day!


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

Date: Fri, 28 Mar 1997 15:42:11 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: Bas van Reek <basvreek@channels.nl>
Subject: Re: passing variables using SSI problem
Message-Id: <333C5753.76A7@egames.com>

[mail&post]
Bas van Reek wrote:
> I have the following problem :
[snipped SSI/CGI problem having nothing 
to do with Perl]

You sure do.  You're lost.  You wanted the
door marked comp.infosystems.www.authoring.cgi.
Or possibly comp.infosystems.www.servers.unix.

Actually what you probably want is to talk to
your webmaster/system-administrator.  Unless
you are he, in which case you probably want to 
read the documentation that comes with Apache
and figure out what's different between the two
installations you're dealing with.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's better to be lucky than good."  -- Elizabeth Bourne



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

Date: 29 Mar 1997 10:14:40 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Perl hourly fees?
Message-Id: <5hjbl0$l99@panix.com>

In <01bc3be3$cce66f00$1894e5cf@nedmondson.iclretail.com> "Neil Edmondson" <neiled@enteract.com> writes:

>I'll do it for $1 less than the others per hour..

Ok. I'll do it for free. Pay up. :)

-- 
Clay Irving                                        See the happy moron,
clay@panix.com                                     He doesn't give a damn,
http://www.panix.com/~clay                         I wish I were a moron,
                                                   My God! Perhaps I am!


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

Date: Sat, 29 Mar 1997 12:15:59 GMT
From: pduff@airmail.net (Patrick Duff)
Subject: Re: Perl mishandles some multidimensional array references???
Message-Id: <33420729.191774953@news.airmail.net>

Dean Inada wrote: 
> On Mar 29,  3:49, Patrick Duff wrote:
> > p.s.:  Here is some code I wrote a few months ago to print-out
> > multidimensional structures.  Enjoy, and thanks for the help!
> But I'd think you must have understood this in order to write that.

It turns out my understanding was incomplete.  Because I understood
them well enough to write programs using them and write the printref()
routine, I thought I knew them throughly.  But I had missed the
difference between what Perl does when one writes

	@Title[0] = ('A1', 'A2', 'A3', 'A4');

and when one writes

	@{$Title[0]} = ('A1', 'A2', 'A3', 'A4');

I expected the first one to do what the second one does, and thought
I'd found an inconsistency when it didn't work as expected.  My
problem was not correctly understanding that I needed to use { } to
say what I meant in this case.  Perhaps by posting this, others who
were unclear on this kind of thing will benefit too.

By the way, your message was the most helpful one I received.  (It
nicely balanced some of the nastier e-mails my post generated!)

-- 
regards, Patrick Duff (pduff@airmail.net)



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

Date: Sat, 29 Mar 1997 13:18:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: perl5 string splitting question
Message-Id: <E7t3Mq.L5E@world.std.com>

Pat Lashley <patl@tencor.com> writes:

>Hi,

>I've got a question for the wizards: What is the BEST
>way to split a string into equal-sized chunks?  (The
>chunk size is known a-priori; but the number of chunks
>in the string is not.)

>I can think of several ways to perform the split; but
>none of them stands out as clearly better than, or even
>less ugly than, the others.

Which ones have you thought of, and why were they rejected? (What if I
give you one that I think is great, but you've already rejected it as
being "ugly")

If the data is in $string, and the length of a chunk is in $size,
these are some candidates:

@data = unpack "A$size" x ( length($string) / $size), $string;

@data = substr $string, @data * $size, size 
           while @data * $size < length $string;

while (length $string) {
  push @data, unpack "A$size", $string;
  substr($string, 0, $size) = '';
}

@data = ($string =~/([\000-\377]{0,$size})/og);
-- 
Andrew Langmead


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

Date: Sat, 29 Mar 1997 16:39:56 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: perl: can't handle large lists?
Message-Id: <5hjfmp$36r$1@news3.microserve.net>

This sounds very much like a programming error.

Need code example to help.

no_junk_mail@my_address.com (Apple-O) wrote:

>I wrote a script that's supposed to read and sort a large database document 
>(1250 lines, 7 fields) by different keys. It worked with a small test list (5 
>lines!) but is behaving quite strangely with the real data. It will output the 
>data for one record repeatedly 5-20 times, then seemingly skip 10-20 records, 
>and do the same thing for the next line. 

>Is perl unable to handle this much data? Can I make provisions so that it is 
>"ready" to? 

>---

>Apple-O
>appleo@cybercomm.net

>Apple-O
>appleo@cybercomm.net




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

Date: Fri, 28 Mar 1997 23:48:48 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: stirra@wwc.edu
Subject: Re: Question on bit-wise and operator
Message-Id: <333CC960.4D95@egames.com>

[mail&post]
stirra@wwc.edu wrote:
> I am trying to strip off bits from an integer to test for a
[snip]
>         POSIX::read($s_in, $rdbyte, 1);
>         $rdtest = ($rdbyte & 0x1f);
> 
> gives me back '0', when I was expecting 000xxxxx (binary).
> Turning on warnings gives me warnings about $rdbyte not being
> an integer.  How do I force $rdbyte to be an integer in the
> absence of typecasting or otherwise get bit-wise operators to
> work?

Try: $rdtest = ord($rdbyte) & 0x1f;
or:  $rdtest = unpack("C", $rdbyte) & 0x1f;

Perl stores numbers as strings not as binary, if you
want the numeric value of a single char, you can use 
ord().
If you want to convert to/from various multi-byte packed
binary values, use pack(), unpack();

see man perlfunc for more detail.

HTH
--
Devin Ben-Hur      <dbenhur@egames.com>
eGames.com, Inc.   http://www.egames.com/
eMarketing, Inc.   http://www.emarket.com/
"It's better to be lucky than good."  -- Elizabeth Bourne



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

Date: 29 Mar 1997 18:25:12 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Question on bit-wise and operator
Message-Id: <5hjmq8$anj$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, stirra@wwc.edu writes:

(What crazy broken software is putting those ugly carriage returns where
 you should have just line feeds?)

:I am trying to strip off bits from an integer to test for a^M
:"stop" character in a packet received from a serial port.  I^M
:am using the Posix module to set up the serial port.  When I^M
:perform the bit-wise 'and', a *logical* result is returned ('0'^M
:or '1') rather than the remaining bits:^M
:^M
:	POSIX::read($s_in, $rdbyte, 1);^M

What aren't you using regular read?

:	$rdtest = ($rdbyte & 0x1f);^M

You seem to think that you read in a number.  You didn't.  You read in
a character.  That's what read does, you know.  See up there where you
specified 1 byte?  That's a byte.  Unlike C, there is a difference in perl
between characters and numbers.  Imagine if the byte you read in were 'A'.
Would you expect to get an 'A' or a 65?  Apparently you think you'd get a
65, or that 'A' would magically change into a 65 when you use the & on it.

It does't.

Perhaps you should think of using

    $rdbyte = getc($s_in);

or 

    read($s_in, $rdbyte, 1) == 1 or die "can't read a byte: $!";

or

    sysread($s_in, $rdbyte, 1) == 1 or die "can't read a byte: $!";

:^M
:gives me back '0', when I was expecting 000xxxxx (binary).^M
:Turning on warnings gives me warnings about $rdbyte not being^M
:an integer.  How do I force $rdbyte to be an integer in the^M
:absence of typecasting or otherwise get bit-wise operators to^M
:work?^M

And then once you have it, 

    $rdtest = ( ord($rdbyte) & 0x1f );

The ord() function finds the ascii number corresponding the first
character of its argument.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
The typewriting machine, when played with expression, is no more
annoying than the piano when played by a sister or near relation.
                --Oscar Wilde


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

Date: Sat, 29 Mar 1997 14:44:01 GMT
From: llanaro@calumet.yorku.ca (Lou Lanaro)
Subject: running .pl with perl.exe ERROR help!
Message-Id: <333d2a6a.53538301@newshub.ccs.yorku.ca>

Hi
I am trying to run wwwnoard.pl  to my page.
First I do not have direct access to the cgi 
but can run .pl by changing your first line of the .pl to:
#!/perl5/bin/perl.exe



is any one familiar with 

500 Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your
request.

Message: CGI output from f:/home/llanaro/www/wwwboard/wwwboard.pl
contained
no blank line separating header and data

Thanks Lou


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

Date: 29 Mar 1997 12:41:09 GMT
From: "Bas van Reek" <basvreek@channels.nl>
Subject: Re: Sending Environment variables to a PERL script using JavaScript
Message-Id: <01bc3c3e$62b1f540$1c0d6dc2@pentium>



I have the same problem, it seems that it does not work
on all servers, i have it working on a server using apache 1.03
but not on another server using apache 1.1.1. (I am not sure if 
the apache server causes the problem)


alastair brown <alastair@redboxad.demon.co.uk> wrote in article
<333A681C.4F22@redboxad.demon.co.uk>...
> Hi All
> 
> I'm am just learning programming using PERL. The script I want to write
> needs to pass client environment variables to my perl script. can this
> be done using javaScript the following way?
> 
> window.location = "http://www.mydomain.com/cgi-bin/links.pl?day=" +
> now.getDay() + "&hour=" + now.getHours());
> 
> Thanks in advance for any help
> 
> Alastair Brown
> 


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

Date: Sat, 29 Mar 1997 13:28:21 GMT
From: "Jaime" <jaime@thepentagon.com>
Subject: Server/Server & Client/Server
Message-Id: <01bc3c45$120ec8a0$28f9989e@default>

Hi, everyone.

I've been doing some CGI scripting using PERL 5 on a System V Release 4.0
server, and am now attempting (to start with) to write a telnet client to run
on this server, so that anyone can use telnet across the web.

The ultimate reason I want to do this is so that I can write a web e-mail
client, by contacting an external POP3 server on port 110 through CGI on a
normal web server.

My problem is that I don't know how to send any sort of sockets request from my
server using it as a client. Is this possible through PERL? Would I be better
using C, and then using PERL as a CGI to C interface?

If you have any answers (or even scripts!), please e-mail me:
Jaime (jaime@thepentagon.com)

Thank-you.


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

Date: 29 Mar 1997 15:58:16 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Server/Server & Client/Server
Message-Id: <5hje6o$j15@fridge-nf0.shore.net>

Jaime (jaime@thepentagon.com) wrote:

: I've been doing some CGI scripting using PERL 5 on a System V Release 4.0
: server, and am now attempting (to start with) to write a telnet client to run
: on this server, so that anyone can use telnet across the web.

Not a good idea if you're planning on implementing telnet through a webpage.
Not a trivial task, either, IMHO, particularly since you might be a novice 
with sockets.

: The ultimate reason I want to do this is so that I can write a web e-mail
: client, by contacting an external POP3 server on port 110 through CGI on a
: normal web server.

Well, then.  This makes more sense.  I'll suggest that you look into:
Net::POP3, and Mail::POP3Client, which already do what you want.  You just
have to put them in the context of the web.  Net::POP3 doesn't contain
any pod documentation (examples), but if you understand terms like "returns
a reference to an array," or "returns a reference to a hash," you'll be
off and running.

: My problem is that I don't know how to send any sort of sockets request 
: from my server using it as a client. Is this possible through PERL? 

See the module(s) above, and you should have to implement anything but a
client ("main program") to do what you want.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 29 Mar 1997 18:54:39 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Smarter indexing algorythm
Message-Id: <5hjohf$ep1@lyra.csx.cam.ac.uk>

Ian Alderman <ian@cs.cornell.edu> wrote:
>If it's acceptable to assume that the six closest zip codes are all
>within a certain range of miles (say 100 miles), you then know that
>the X coordinates of any two close zip codes must also be within this
>range of miles.  You could use this to limit the number of comparisons
>made.
>
>You could sort the zip codes on the X coordinate.  Then, for each zip
>in the sorted array, check following zips in the array as you have
>below, until you get to a zip that's more than 100 miles away in just
>X, then "next OUTER", since you won't get any more matches anyway.
>You'll have to either scan backwards or put found matches in both
>zip's lists.  Hope this helps!

No need to make any assumptions about closeness.   Just sort by X
coordinate as suggested, then for each zip code:

search outwards from the given code (going both up and down in X),
computing distances.   Keep the six smallest you find.   When the
X coordinate difference exceeds the distances of the current six smallest,
give up.


Mike Guy


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

Date: 29 Mar 1997 16:29:21 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5hjg11$nqc$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 22 Mar 1997 10:28:38 GMT and ending at
29 Mar 1997 09:26:17 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^(>|:|\S+>)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.

Totals
======

Total number of posters:  465
Total number of articles: 1052
Total number of threads:  401
Total volume generated:   2005.4 kb
    - headers:    743.1 kb
    - bodies:     1201.8 kb (872.3 kb original)
    - signatures: 58.3 kb

Averages
========

Number of posts per poster: 2.3
Number of posts per thread: 2.6
Message size: 1952.0 bytes
    - header:     723.3 bytes
    - body:       1169.8 bytes (849.1 bytes original)
    - signatures: 56.8 bytes

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

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

   66   103.5 ( 53.8/ 49.6/ 36.6)  Tom Phoenix <rootbeer@teleport.com>
   51    87.9 ( 39.8/ 39.1/ 28.8)  Tom Christiansen <tchrist@mox.perl.com>
   39    85.7 ( 27.2/ 58.5/ 40.3)  Simon Hyde (aka Jeckyll) <shyde@poboxes.com>
   34    42.9 ( 20.4/ 22.5/ 17.1)  Nathan V. Patwardhan <nvp@shore.net>
   25    50.3 ( 15.0/ 35.2/ 23.8)  Tad McClellan <tadmc@flash.net>
   22    41.1 ( 14.2/ 26.9/ 12.8)  Eric Poindexter <eric@nettown.com>
   19    44.2 ( 14.9/ 22.2/ 11.9)  Randal Schwartz <merlyn@stonehenge.com>
   18    25.6 ( 11.3/ 14.3/ 11.3)  Geoffrey Hebert <soccer@microserve.net>
   18    27.4 ( 10.8/ 16.6/  9.4)  Eric Bohlman <ebohlman@netcom.com>
   17    28.9 ( 12.6/ 16.2/  7.9)  Douglas Seay <seay@absyss.fr>

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

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

 196.4 (  2.9/193.5/156.7)      4  The Viper <viper@buri.kuentos.guam.net>
 103.5 ( 53.8/ 49.6/ 36.6)     66  Tom Phoenix <rootbeer@teleport.com>
  87.9 ( 39.8/ 39.1/ 28.8)     51  Tom Christiansen <tchrist@mox.perl.com>
  85.7 ( 27.2/ 58.5/ 40.3)     39  Simon Hyde (aka Jeckyll) <shyde@poboxes.com>
  50.3 ( 15.0/ 35.2/ 23.8)     25  Tad McClellan <tadmc@flash.net>
  44.2 ( 14.9/ 22.2/ 11.9)     19  Randal Schwartz <merlyn@stonehenge.com>
  42.9 ( 20.4/ 22.5/ 17.1)     34  Nathan V. Patwardhan <nvp@shore.net>
  41.1 ( 14.2/ 26.9/ 12.8)     22  Eric Poindexter <eric@nettown.com>
  28.9 ( 12.6/ 16.2/  7.9)     17  Douglas Seay <seay@absyss.fr>
  27.4 ( 10.8/ 16.6/  9.4)     18  Eric Bohlman <ebohlman@netcom.com>

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

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

   37  Unix and ease of use  (WAS: Who makes more ...)
   18  What's a good Perl book?
   17  term 'regular expressions' considered undesirable
   15  A Call for Clarity (Schwartzian Transform Considered Scary)
   14  Unix 'Cat' equivelent
   14  regular expression for check lower case
   14  Regular Expresion question.
   13  global my() variable used in foreach() loop loses its value
   10  Directory Listing in Perl
   10  Who makes more $$ - Windows vs. Unix programmers?

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

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

 191.2 (  2.0/189.2/152.3)      3  ZFilter 2.7 Release Package
 114.0 ( 55.8/ 55.0/ 31.0)     37  Unix and ease of use  (WAS: Who makes more ...)
  38.4 ( 12.6/ 24.3/ 17.1)     17  term 'regular expressions' considered undesirable
  35.3 ( 11.0/ 22.8/ 17.6)     15  A Call for Clarity (Schwartzian Transform Considered Scary)
  31.0 ( 15.0/ 13.5/  8.7)     18  What's a good Perl book?
  29.1 (  9.3/ 18.7/ 13.5)     14  Regular Expresion question.
  27.2 ( 15.7/ 11.1/  4.3)     10  Who makes more $$ - Windows vs. Unix programmers?
  23.2 (  8.6/ 13.9/  8.3)     13  global my() variable used in foreach() loop loses its value
  20.3 (  9.5/  9.9/  6.1)     14  regular expression for check lower case
  19.2 (  2.7/ 10.8/  6.6)      4  Perl mishandles some multidimensional array references???

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

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

      56  comp.lang.tcl
      54  comp.lang.javascript
      53  comp.lang.basic.visual
      52  comp.databases
      52  comp.lang.c
      52  comp.lang.c++
      51  comp.os.linux.advocacy
      51  comp.os.ms-windows.advocacy
      51  comp.unix.advocacy
      47  comp.object

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

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

      78  "Tim Behrendsen" <tim@a-sis.com>
      49  Michael Craft <jsi@idiom.com>
      36  Stephane Plattner <NOSPAMplas@fmi.ch>
      31  csweber@flash.net
      31  Steve Mading <madings@earth.execpc.com>
      21  Steven W McDougall <swmcd@world.std.com>
      20  "E. Armstrong" <earmstg@anet-stl.com>
      20  ecunha@foxboro.com
      20  DarkElf@SLSoftware.reno.nv.us
      20  sp@system.ptv.de*


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

Date: Sat, 29 Mar 1997 17:03:29 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Wrapping text in perl
Message-Id: <5hjh2u$3l6$1@news3.microserve.net>

A better solution will be to use html.

define your testarea a 40 
in the textare definition include a WRAP=PHYSICAL

Then you user will see exactly what you file away.

Alan Bond <alanbond@sky.net> wrote:

>Yes, I am a perl novice.

>Word wrap in perl?

>I have a string that represents the contents of a text field from
>a form.  The text field on the form has auto-wrapping.  When my
>perl program gets the string, it is one long string.  Does anyone
>know a snippet of code I could use to reformat the string and insert
>newline characters at whitespace after, say 40 characters?

>Thanks.

>Alan Bond




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

Date: Sat, 29 Mar 1997 18:41:53 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Wrapping text in perl
Message-Id: <5hjmrc$4ns$1@news3.microserve.net>

Perhaps an example

http://www.microserve.net/~soccer/cgil/emailform.cgi?casl

look at the source and check out the text area


Alan Bond <alanbond@sky.net> wrote:

>Yes, I am a perl novice.

>Word wrap in perl?

>I have a string that represents the contents of a text field from
>a form.  The text field on the form has auto-wrapping.  When my
>perl program gets the string, it is one long string.  Does anyone
>know a snippet of code I could use to reformat the string and insert
>newline characters at whitespace after, say 40 characters?

>Thanks.

>Alan Bond




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

Date: Sat, 29 Mar 1997 19:05:59 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Wrapping text in perl
Message-Id: <5hjo8i$50p$1@news3.microserve.net>

That "wrap"  works for netscape and IE which covers 70-80% or more.
I have not tested it everywhere, but it works for 100% of my users.



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

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

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