[12242] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5842 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 31 18:07:29 1999

Date: Mon, 31 May 99 15:00:22 -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           Mon, 31 May 1999     Volume: 8 Number: 5842

Today's topics:
    Re: "Sticking" together bitmaps on hit counters. (Abigail)
    Re: Anyone know where to get (buy) custom made pearl sc (Abigail)
    Re: Can Perl call C functions? <aqumsieh@matrox.com>
    Re: Couple of basic questions from newbie (Abigail)
    Re: current date <cassell@mail.cor.epa.gov>
    Re: Expire a Page (Abigail)
        handle an I/O card with perl (Manuel Moreno)
    Re: Im not asking for much <cassell@mail.cor.epa.gov>
        image via cgi perl on netscape navigator (Bradley Elfman)
    Re: image via cgi perl on netscape navigator <rootbeer@redcat.com>
        Is (surprisingly, amazingly) slow? <jonathan@meanwhile.freeserve.co.uk>
        Is split (surprisingly, amazingly) slow? <jonathan@meanwhile.freeserve.co.uk>
    Re: Opendir on the root of a NT Server <cassell@mail.cor.epa.gov>
        passing Perl <--> C arguments <_jj_@dpi.es>
    Re: passing Perl <--> C arguments <rootbeer@redcat.com>
    Re: Perl, Y2K, and idiots <kristina@greatbasin.net>
    Re: Perl, Y2K, and idiots (I R A Aggie)
    Re: Quick way to count lines in file? (Abigail)
    Re: Slow, or looping? (Abigail)
    Re: Sort process (Larry Rosler)
    Re: Use binmode for binary files <flavell@mail.cern.ch>
    Re: where can i get a free Perl compiler on line? <arsen@freesurf.ch>
    Re: where can i get a free Perl compiler on line? <tchrist@mox.perl.com>
    Re: Why does NT server return the actual script, not th (Bradley Elfman)
    Re: Y2K infected Perl code (I R A Aggie)
    Re: Y2K infected Perl code <kristina@greatbasin.net>
    Re: Y2K infected Perl code <kristina@greatbasin.net>
    Re: Y2K infected Perl code <gellyfish@gellyfish.com>
    Re: Y2K infected Perl code <gellyfish@gellyfish.com>
    Re: You can earn $50,000 40686 (Why?)
    Re: You can earn $50,000 40686 <MenThal@bigfoot.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 31 May 1999 13:44:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: "Sticking" together bitmaps on hit counters.
Message-Id: <slrn7l5mhg.fvi.abigail@alexandra.delanet.com>

Thurley (thurley@globalnet.co.uk) wrote on MMXCVIII September MCMXCIII in
<URL:news:7iscjd$gkp$1@gxsn.com>:
** I want to create a graphical hit counter, but I cannot figure out how to
** stick different bitmaps together to make one long number.  Any help would be
** apreciated.


Krazy glue should do it.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 31 May 1999 13:54:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Anyone know where to get (buy) custom made pearl scripts?
Message-Id: <slrn7l5n5c.fvi.abigail@alexandra.delanet.com>


rec.gems.pearls.scripts



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 31 May 1999 16:59:38 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Can Perl call C functions?
Message-Id: <x3yg14d3qh1.fsf@tigre.matrox.com>


sbeaulieu@my-deja.com writes:

> Like the subject says, can perl call C funtions?  If so, how can that
> be done?

Yes .. by reading the proper docs. Here are the most relevant docs in
random order:

perldoc perlembed
perldoc perlcall
perldoc perlxs

HTH,
Ala



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

Date: 31 May 1999 13:47:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Couple of basic questions from newbie
Message-Id: <slrn7l5mmr.fvi.abigail@alexandra.delanet.com>

marshal@marshal.co.uk (marshal@marshal.co.uk) wrote on MMXCVIII September
MCMXCIII in <URL:news:375185b3.3132021@fleece.argonet.co.uk>:
## OK - just starting and this will be a long row to hoe. One specific
## and one general question.
## 
## 1) I note that the perl print statment (command? Method?) hates having
## double quotes in it - so far I have always had to remove them to make
## the script work. BUT HTML tags often require attributes in quotes. Is
## the solution an escape character of some sort or something I've
## missed?

You are mistaken. print() will print double quotes just fine.

You may have problems in putting a double quote inside a double quoted
string. The solution is to either use different quoting characters, or
to escape the double quotes. This is all explained in the perlop manual.

## 2) Can I use perl to create, open, write to, up-date and delete files
## on the server? No need for explaination of how - just that the product
## I'm aiming at will need that (or some other solution) and I want to
## know if I'm barking up the right tree.

Yes.


Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 31 May 1999 14:54:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: current date
Message-Id: <375304FA.6684DFF5@mail.cor.epa.gov>

Joakim Hove wrote:
> 
> slegarre@ireste.fr writes:
> 
> > Hello,
> >
> > I need the date of the day, is there a function provided it?
> 
> perldoc -f time
> perldoc -f localtime
> 
> Or, if you are satisfied with a quick and dirty solution
> 
> $now = `date`;
> 
> This last solution works fine on Unix platforms, but I don't know
> about other platforms. On a Unix box "man date" will tell how you can
> format the output from "date".

Ouch.  This is the *slow* and grotty solution.  Try:

$now = localtime;   # localtime() in scalar context

This works on *all* Perl platforms.  It doesn't call a shell
and waste time/CPU/everything-else.  It doesn't depend on
having a date() program identical to unix-ish ones.  It
doesn't hang horribly on certain non-unix platforms.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 31 May 1999 13:49:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Expire a Page
Message-Id: <slrn7l5mra.fvi.abigail@alexandra.delanet.com>

Matt (splinter@monmouth.com) wrote on MMXCVIII September MCMXCIII in
<URL:news:7isavd$8is$1@news.monmouth.com>:
~~ Objective: I want to make a page expire after x minutes or seconds.
~~ 
~~ Details:  I have to create a new page, write HTML to it, send the user
~~ there, then after the user is done with that page the page would expire so
~~ no one could go back to it.  How would this be done?


Easy. Send the page to the user and immediately shutdown the server.


HTH. HAND.


Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 31 May 1999 00:43:16 +0200
From: menesesANTIBASURA@ctv.es (Manuel Moreno)
Subject: handle an I/O card with perl
Message-Id: <slrn7l3fo4.jo.menesesANTIBASURA@B52.net>

Hello,

I'm in the need to control an 8255 based I/O card on a IBM-PC compatible.

There is not much hard disk space so I need to use the MSDOS operating
system but I would like to use Perl on it.

Would it be very difficult to access the I/O port with Perl with this
environment?.

-- 
   /\    Quitar ANTIBASURA para contestar por e-mail
  /  \   Remove ANTIBASURA to reply via e-mail
 /____\  Manuel Moreno - Albacete - Spain
 \    /  
  \  /  
   \/  


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

Date: Mon, 31 May 1999 14:26:24 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: John Callender <jbc@shell2.la.best.com>
Subject: Re: Im not asking for much
Message-Id: <3752FE80.829F7AC@mail.cor.epa.gov>

[courtesy cc to poster]

John Callender wrote:
> 
> [a lot of good points that I am going to snip quite ruthlessly] 
>
> And yet, *lots* of people are doing it. I think the conventional wisdom
> in these parts that "Perl is a poor choice as a 1st programming
> language" could use a little scrutiny.
>
> [BIG SNIP]

John,

While I agree with all your other points, and applaud your
effort in bringing them out, I would like to disagree [slightly]
on this point.  I think that for many, the view is not that Perl
is a poor choice as a 1st language, but that Perl is a lot easier
to learn if it is *not* one's 1st language.

A concerted effort to be a little more helpful to the clue-
challenged could be good for us.  In particular, we can
certainly refer people to 'beginner' web-based tutorials
if they have no idea what a variable is, or an array, or...
That is, in the situation where they will not yet benefit
from "Learning Perl" [hey Tom, note that *I* know you're a
co-author :-], there are learning media from which they can
benefit.  I have been referring people to
http://www.netcat.co.uk/rob/perl/win32perltut.html
but that may not be the best option.  Other suggestions of
sites which have been given at least a quick check for 
accuracy?

Similarly, we need to be able to refer people to places where
they can get help, rather than give them help they don't
comprehend.  I have had several people reply to me personally
that they didn't have one or more of: the pod files; the html
files; the manpages; and/or perldoc.  I have referred a few 
people to Dave Cross's article for PerlMonth.  But some of
these people are struggling to use Perl on their ISP's
machine when they haven't been told they can get it for their
own machine as well.  And some have even had the bad karma
to use the "Perl for Dummies" which apparently has no docs
included.  How lame and pathetic can you get?

Is it sufficient to direct these webbies to websites which
can teach them enough basics to begin learning Perl?  Do we
need to have some repository where we grade these tutorials,
or where we maintain some notes on ghastly flaws of popular
Perl webscripts?  [You all know whose scripts I have in mind
here.]

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 31 May 1999 20:36:39 GMT
From: physics@netdepot.com (Bradley Elfman)
Subject: image via cgi perl on netscape navigator
Message-Id: <3752f0dd.21273422@news.netdepot.com>

    I have not been able to use a perl script with cgi.pm to load an
image on netscape navigator 4.6  run as a test from my hard drive
offline
    i just get one of those funny looking little image substitutes
the alternate label works fine   
    no error messages  and i have used both

print img ({src=>"Electron.gif"});

and

print "<img src = 'Electron.gif'>";

    i have tried every kind of path for the source file (eee.g.,
C:/Apache/cgi-bin/Electron.gif       this is what works on ie 5.0    
     although the file name should suffice if the image is in the same
directory as all else.

the image loads fine on ie 5.0

i am running my cgi perl scripts off of an apache web server running
under window nt server

i am guessing all will work ok when uploaded to my unix server but
would like to see it work first on my hard drive offline

if i use the <img src = "Electron.gif" width = 400 height = 400> on a
bare html file it works just fine on both navigator and ie

i have also tried several different images both gif and jpg

does anyone have any idea what could be the problem, why navigator
refuses to load the image.


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

Date: Mon, 31 May 1999 14:02:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: image via cgi perl on netscape navigator
Message-Id: <Pine.GSO.4.02A.9905311400110.19186-100000@user2.teleport.com>

On Mon, 31 May 1999, Bradley Elfman wrote:

>     I have not been able to use a perl script with cgi.pm to load an
> image on netscape navigator 4.6  run as a test from my hard drive
> offline

It sounds (from the remainder of your description) as if you're having
trouble configuring your webserver to run scripts of any kind, not just
Perl programs.

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

Hope this helps!

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



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

Date: Mon, 31 May 1999 21:49:37 +0100
From: "Jonathan" <jonathan@meanwhile.freeserve.co.uk>
Subject: Is (surprisingly, amazingly) slow?
Message-Id: <7iusku$ei1$1@news8.svr.pol.co.uk>

A couple of weeks ago there was a posting on c++ moderated and
comp.lang.python called "An efficient split function".
Among other things it contained Perl and Python code to - well, to do this:


    my $count = 0;
    my @v;
    while (<STDIN>) {
        @v = split(/\|/);
        $count++;
    }
    print "$count\n";


In other words, to count the total number of field separated data items in a
file.

The author of the post was surprised because the Python version ran **4**
times as fast as the Perl code above on large files.  And with fairly
minimal effort he was able to write C++ and STL code that ran more than 30
times faster than the Perl above. (And generally STL code can be replaced
with C several times faster on current compilers.)

Both these things surprised me greatly. I've only had time to play around
with Perl for just over a week (and that was a couple of months ago, I'll be
getting back to it at the end of my current project) but I was very pleased
by how fast and efficient it seemed (it was also a lot of fun.) I asked the
guy who made the post whether he had tried gulp mode, but apparently the
file was too large for gulp to work. He doesn't seem to have followed this
up any of the Perl groups, and I can't resist asking any longer, so - Any
suggestions as to what's going on here, or faster alternatives to the code
above?

Jonathan Coupe, XWare





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

Date: Mon, 31 May 1999 22:12:40 +0100
From: "Jonathan" <jonathan@meanwhile.freeserve.co.uk>
Subject: Is split (surprisingly, amazingly) slow?
Message-Id: <7iuu05$fq7$1@news8.svr.pol.co.uk>

A couple of weeks ago there was a posting on c++ moderated and
comp.lang.python called "An efficient split function".
Among other things it contained Perl and Python code to - well, to do this:


    my $count = 0;
    my @v;
    while (<STDIN>) {
        @v = split(/\|/);
        $count++;
    }
    print "$count\n";


In other words, to count the total number of field separated data items in a
file.

The author of the post was surprised because the Python version ran **4**
times as fast as the Perl code above on large files.  And with fairly
minimal effort he was able to write C++ and STL code that ran more than 30
times faster than the Perl above. (And generally STL code can be replaced
with C several times faster on current compilers.)

Both these things surprised me greatly. I've only had time to play around
with Perl for just over a week (and that was a couple of months ago, I'll be
getting back to it at the end of my current project) but I was very pleased
by how fast and efficient it seemed (it was also a lot of fun.) I asked the
guy who made the post whether he had tried gulp mode, but apparently the
file was too large for gulp to work. He doesn't seem to have followed this
up any of the Perl groups, and I can't resist asking any longer, so - Any
suggestions as to what's going on here, or faster alternatives to the code
above?

Jonathan Coupe, XWare






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

Date: Mon, 31 May 1999 14:41:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Opendir on the root of a NT Server
Message-Id: <37530210.B6720D87@mail.cor.epa.gov>

Mike Mc Mahon wrote:
> 
> I am trying to do an opendir() of the root of an NT server share and it is
> failing. I am not using UNC convention and the userid has full rights to the
> share. I can open a directory off the root but I cannot open the root.

What was the error message you got back?

Umm, you did check the status of your call, and print out $! , 
right?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 31 May 1999 22:00:43 +0200
From: "jj" <_jj_@dpi.es>
Subject: passing Perl <--> C arguments
Message-Id: <7iupqp$ii414@esiami.tsai.es>

Hi all,
I've to connect 2 CGIs, one written in C and the other in Perl.

How can I pass some arguments from one to another, from Perl to C and
viceversa?

I mean, I must pass these arguments as URL encoded (just like a web page
sends them) but I am NOT sure what's the way and what're the exact
instructions both in Perl or C. My problem is not to get the arguments but
passing them... how?

I've read a lot of documentation about but I've still NOT found the clue.

Thanks a lot
jj (jj@dpi.es)




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

Date: Mon, 31 May 1999 14:06:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: passing Perl <--> C arguments
Message-Id: <Pine.GSO.4.02A.9905311403540.19186-100000@user2.teleport.com>

On Mon, 31 May 1999, jj wrote:

> I've to connect 2 CGIs, one written in C and the other in Perl.

No doubt you mean CGI programs (not Common Gateway Interfaces, of which
you should have only one. :-)

> How can I pass some arguments from one to another, from Perl to C and
> viceversa?

By implementing the Common Gateway Interface in each (from the server's
side in one of them).

You can find more information in the docs, FAQs, and newsgroups about CGI.
Here's the CGI spec's home.

    http://hoohoo.ncsa.uiuc.edu/cgi/

Good luck!

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



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

Date: Mon, 31 May 1999 12:18:33 -0700
From: Kristina  <kristina@greatbasin.net>
Subject: Re: Perl, Y2K, and idiots
Message-Id: <Pine.BSI.4.05L.9905311146290.24051-100000@web0.greatbasin.net>

On Fri, 28 May 1999, Eric Bohlman wrote:

> Or the more prosaic "Anthem for the Year 19100"?
> 
> : http://www.linguistic-funland.com/scripts/RemindMe/remindmecgi.txt
[buggy code deleted]
> 
> How about "Anthem for the Year 20100"?  Sounds a little hard to sing.
[lyrics to Anthem deleted]
> 
> This script must have been written by a member of the Campaign for
> Non-Monotonic Time. 

Guilty. Sing along, everyone!  Seriously, though, the quoted code was
taken from something I wrote after looking at someone else's code, and
making an assumption of what localtime() returned, rather than checking
the docs.  So: I made a mistake and I learned a lesson. Bad Kristina!  No
cookie!  

For some people, programming skill (in any language) apparently springs
full-fledged from their brains at birth.  Others (like me) are not so
lucky and have to dog-paddle their way through it by looking at other code
(which may be buggy) and assuming it works.  As we go on, we think, "Geez,
this was really kind of difficult.  I know of at least 10 other people in
my situation whose school administrators have said, 'Get some cgi stuff up
by Thursday,' so I think I'll post this stuff and help them avoid going
through the panic I went through."  And, voila: buggy code makes it to the
web.

> once said "Design a system that can be used by idiots and only an idiot
> would want to use it."  

In all fairness, everyone has to start somewhere.  However, there
seems to be a great deal of resentment here for people who are just 
starting out.  Are we, then, idiots for wanting to learn some kind of
programming language, choosing Perl, and not immediately understanding
correct programming structure and so forth?  We start out, we do stupid
things, and even post them, but at least as we learn we patch things and
even notify people using them as much as possible.  When someone points
out a bug, we fix it, and learn something else that we didn't know.  In
the meantime, maybe someone else gets an introduction to Perl and starts
their learning process. 

Okay, I realize the flames ("Yes, Kristina, you are idiots for wanting to
learn Perl when you don't have the background") are bound to begin now, so
I'll put on my asbestos coat and sit back.  I just wonder if it would more
helpful to people like me to give them the benefit of the little I've
learned by posting my scripts, or to hide them away forever because
they're not good examples of programming code.  After all, I can only be
ridiculed so much before people get tired of it. :)

Kristina




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

Date: 31 May 1999 19:53:37 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl, Y2K, and idiots
Message-Id: <slrn7l5qc4.su3.fl_aggie@thepentagon.com>

On Mon, 31 May 1999 12:18:33 -0700, Kristina <kristina@greatbasin.net>, in
<Pine.BSI.4.05L.9905311146290.24051-100000@web0.greatbasin.net> wrote:

+ So: I made a mistake and I learned a lesson.

And we have a winner. Thus is the beginning of wisdom.

+ Okay, I realize the flames ("Yes, Kristina, you are idiots for wanting to
+ learn Perl when you don't have the background") are bound to begin now,

Why? I would have suggested that you learn to program, then learn
perl. You have not. *shrug* That doesn't make you bad, it just steepens
the learning curve, and increases the odds of making a blunder...

James - like *I've* never made a blunder...heh...


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

Date: 31 May 1999 15:21:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Quick way to count lines in file?
Message-Id: <slrn7l5s7i.fvi.abigail@alexandra.delanet.com>

Joel Wijngaarde (vasquez@zap.a2000.nl) wrote on MMXCIX September MCMXCIII
in <URL:news:37527898.2C18A972@zap.a2000.nl>:
## Hi
## 
## I need to put data into an array but i don't know the file size (in
## lines) in advance.
## Is there a quick/smart way of getting this information or do i have to
## read every line and use a counter?

So? Have you studied how Perl arrays work? If you have, you wouldn't
be asking such questions. Perl isn't C.


    open (FILE, "file") or die "Failed to open file: $!";
    my @array = <FILE>;
    close FILE;



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 31 May 1999 15:16:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Slow, or looping?
Message-Id: <slrn7l5ruv.fvi.abigail@alexandra.delanet.com>

Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on MMXCVIII September
MCMXCIII in <URL:news:7is7tq$9ll$1@mathserv.mps.ohio-state.edu>:
^^ 
^^ Dear neighboors, please stop calling "exponential" things which are
^^ not.  The time of execution of the above fragment is proportional to
^^ the number-of-partitions function p(n), and log p(n) is not Omega(n).
^^ 
^^ The above thing is highly super-exponential.  The Hardy--Ramanujan
^^ asymptotic formula for p(n) shows that log p(n) is Omega(n^k), with k=4/3.
^^ 


If something is not Omega (n), how can it be Omega (n^e) for e > 1 ?

What kind of definition of Omega are you using???



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 31 May 1999 11:32:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Sort process
Message-Id: <MPG.11bc756786f8c46f989b3c@nntp.hpl.hp.com>

In article <lzzp2l8urt.fsf@linux_sexi.neuearbeit.de> on 31 May 1999 
11:15:34 +0200, Marko R. Riedel <mriedel@neuearbeit.de> says...
> twarren10@aol.com (Twarren10) writes:
> > I am a new Pearl programmer who is working on a search program, which
> > uses a pipe delimited databases (|). Everything is working great in
> > search, the problem I am having now is in sorting the results in order to list
> > the matches which have more of the search terms higher than the matches which
> > have less. I know how to sort alphabetically, but this has me stumped. Can
> > anyone give me an idea how to accomplish this? Your help would be appreciated.
 ...
>   my (@terms)=@ARGV;
>   my (@data)=map {
>     chomp; [ split /\|/ ];
>   } <STDIN>;
>   my (@counts)=(0) x ($#data+1);
> 
>   for(my $ind=0; $ind<=$#data; $ind++){
>       foreach $term (@terms){
> 	$counts[$ind]++ 
> 	  if grep /\Q$term\E/, @{$data[$ind]};
>       }
>     }
> 
>   
>   my @result = 
>     map { $data[$_] } sort { -($counts[$a] <=> $counts[$b]) } 
>      (0..$#data);
> 
>   $\="\n"; foreach $line (@result){
>     print join '|', @$line;
>   }

That seems like an awful lot of heavy lifting, including the use of a 
search algorithm that is described in perlfaq6 ("How do I efficiently 
match many regular expressions at once?") as "super-inefficient".

I adapted your basic idea of the indexed sort, added word-boundary 
breaks to the search, dropped the unnecessary chomps, splits and joins, 
and get this (tested but not benchmarked):

  my $terms = '\b(' . join('|' => map "\\Q$_\\E" => @ARGV) . ')\b';
  my @data  = <STDIN>;
  my @counts;
  my $ind   = -1;

  for (@data) {
	$counts[++$ind] = 0;
       $counts[$ind]++ while /$terms/go;
  }

  print @data[ sort { $counts[$b] <=> $counts[$a] } 0 .. $#data ];

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 31 May 1999 20:35:42 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Use binmode for binary files
Message-Id: <Pine.HPP.3.95a.990531201458.6823H-100000@hpplus01.cern.ch>

On Mon, 31 May 1999, Larry Rosler wrote:

> >  ...    And should use 
> >   LR> 'binmode' for binary files.  All the time.
> > 
> > reasonable idea. but of course it never seems to get done.
> 
> That is because neither the teachers nor the books nor the docs present 
> it that way.

Well, it's my observation that quite a few teachers have decided that
the unix way is incomparably best, and the difference doesn't matter in
unix, and therefore they (implicitly or in some cases explicitly) seem
to conclude that it's best not taught, in the hope of reinforcing the
student's allegiance to the one true way of doing things.  (Yes, I'm
overdoing this a bit, but you get the idea.) 

Which is now turning out to be a pity, as perl has loosened its ties to
unixoid OSes and branching out to Macs, Win/xx-es and so on.

It's frustrating, the way that some unix-centered programmers find it so
hard to distinguish conceptually between a linefeed character (as an
ASCII control character) and a newline or record terminator (as a
functional concept). I've often experienced a complete breakdown in
communication with some of them on this topic, because they'll keep
saying the one and meaning the other, arguing themselves around in
circles and getting nowhere.

It's a bit like trying to talk to a C programmer about data records that
contain bytes of value zero...

Having spent some years with IBM mainframes, where the record terminator
wasn't even a data character at all, I feel this problem particularly
acutely. 

> 2.  On some legacy systems, records ('lines') are defined by structures 
> imposed by the file system, rather than by embedded characters in a byte 
> stream.  On such systems, the binmode() distinctions become critical.

That sounds familiar.  ;-)

all the best



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

Date: Mon, 31 May 1999 23:05:00 +0200
From: "arsene" <arsen@freesurf.ch>
Subject: Re: where can i get a free Perl compiler on line?
Message-Id: <928184733.223374@unet.urbanet.ch>

Not free - trialware (50$ for the Lite one) , but easy to use :
http://www.perl2exe.com/
Arshne


Eddie <edruba@cruzio.com> a icrit dans le message :
7itaqd$e7b@enews2.newsguy.com...
I use win98, i need to know if there  is a free perl compiler online for
win98.can you tell me  which web site, i can go to download it.
Thanks.

Eddie R








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

Date: 31 May 1999 15:42:20 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: where can i get a free Perl compiler on line?
Message-Id: <3753023c@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "arsene" <arsen@freesurf.ch> writes:
::I use win98, i need to know if there  is a free perl compiler online for
::win98.can you tell me  which web site, i can go to download it.
:Not free - trialware (50$ for the Lite one) , but easy to use :
:http://www.perl2exe.com/

Since when is that a compiler?

--tom
-- 
The hardest thing in the world to understand is the income tax.
                --Albert Einstein


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

Date: Mon, 31 May 1999 21:03:35 GMT
From: physics@netdepot.com (Bradley Elfman)
Subject: Re: Why does NT server return the actual script, not the print items.
Message-Id: <3752f816.23122618@news.netdepot.com>

On Sun, 09 May 1999 02:12:12 GMT, rstacy@nf.sympatico.ca (R. S.)
wrote:

>I am attempting to have a perl script return anything to a browser but
>all I can get is the actual script itself. The .pl is associated with
>the perl.exe on the server and works when executed on the server but
>when I execute the script from a browser I get a copy of the script
>itself. 
>


r stacy

yes this is terribly frustrating!!

this often happens when the print statements precedes the print header
statement and it may also be better to put all your print statements
after print header and print start_html()

i am running perl using cgi.pm from nt server using apache webserver
i am only testing it offline directly from my hard drive but have not
problem implementing just about anything (except loading an image onto
netscape navigator 4.6).

if you are running the same thing   perl cgi.pm using apache web
server and windows nt server

i would be glad to send u one of my scripts that is working

bradley
physics@netdepot.com
www.netdepot.com/~physics


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

Date: 31 May 1999 19:48:23 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Y2K infected Perl code
Message-Id: <slrn7l5q29.su3.fl_aggie@thepentagon.com>

On Mon, 31 May 1999 13:06:06 -0400, Bill Jones <bill@fccj.org>, in
<3752c142.0@usenet.fccj.cc.fl.us> wrote:

+ Maybe, instead of writing FAQs, this group

AFAIK, only a handful of people write the FAQ's.

+ could collaborate on fixing some widely looked for scripts?

I suppose if we all just gave up net.news there would be time
a plenty...but I have personal pet projects I'd like to work
at, too.

James - like a script to parse a slrn kill file and remove outdated
        entries, for instance...and learning Just Enough slang to talk
        to perl...


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

Date: Mon, 31 May 1999 13:02:14 -0700
From: Kristina  <kristina@greatbasin.net>
Subject: Re: Y2K infected Perl code
Message-Id: <Pine.BSI.4.05L.9905311255290.24051-100000@web0.greatbasin.net>



On 30 May 1999, Malcolm Ray wrote:

> All opens are checked, but pipe closes aren't: presumably the author
> hasn't read perlipc.

I have now. :)

>  No file locking is used where files are opened
> for writing, so there's a distinct danger of data loss.

On several places where it was used, there was no file locking at the
time, but that's not really an excuse.

> The program uses its own password file to protect data, but rather than
> use a decent one-way encryption algorithm, the author has invented her
> own insecure alternative.  A comment shows that she's aware that it's
> insecure; perhaps she's unaware that better alternatives are available.

There wasn't, at the time.  Now, I'd use crypt() most likely.

> You found those examples.  Did you alert the authors to their Y2K bugs?

Nope.  I wasn't notified, at least.

> After all, it would surely be irresponsible to use their code to
> illustrate bad practice without giving them a chance to fix it.
> In case you didn't, I've contacted them.

For which, my thanks.  A lot of that is old legacy stuff, but your
note really brought home the need to go back over all my old archived
scripts and use the things I've learned to improve the code. Not to
mention the need to read more of tfm now that I don't have to worry
about Perl 4 as much.  I'm off to fix many many bugs now...

Kristina



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

Date: Mon, 31 May 1999 13:13:02 -0700
From: Kristina  <kristina@greatbasin.net>
Subject: Re: Y2K infected Perl code
Message-Id: <Pine.BSI.4.05L.9905311304560.24051-100000@web0.greatbasin.net>



On Mon, 31 May 1999, Bill Jones wrote:

> In article <x7iu99gaqx.fsf@home.sysarch.com>, Uri Guttman <uri@sysarch.com>
> wrote:
> 
> > i don't mean to be down on you, but why would you (or anyone) post a
> > script if you are not a programmer? what bewilders me is why there is so
[snip]
> 
> These non-programmers are posting, possibly, because
> they see a need that isn't being met (discounting those
> that want something for nothing.)

That's why I post my scripts, bugs and all: Once, I needed scripts to do
what mine do.  There weren't any, or there weren't any that would work for
what I needed to do.  Other people in similar situations asked if they
could use them, so I started posting them. I still maintain that posting
scripts that English teachers can get working for their students is better
than sitting on said scripts because they're not good code.  As people
tell me about bugs (or I read about them in tfm), I try to fix them. As I
learn, the scripts improve, and some people are happy because they have
something they can use.  

I have to say though, I'm wincing quite a bit reading Malcolm's commentary
on the one script of mine that was posted.  I'd forgotten how bad it was.


Kristina



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

Date: 31 May 1999 18:38:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Y2K infected Perl code
Message-Id: <7iukvi$4ik$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Ralph Daugherty <ralph@ee.net> wrote:
> Scott McMahan wrote:
>> 
>> > Sorry,  are you saying that you have seen a specification for a *Perl*
>> > program that prescribes the use of: $year = '19' . $year ?  Whoaaa .
>> 
>> The nice thing about Open Source is, you can always hack
>> the interpreter to change any string concatenation of
>> a three-digit number to the literal "19" to be an addition.
>> Problem solved.
>> 
>> Scott
> 
> 
>      Is this one of the brilliant Perl programmers that you guys are so
> arrogant about?  Problem solved.  Yes indeed.
> 

Thank you for your incisive contributon to this thread.

*plonk*

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 31 May 1999 18:40:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Y2K infected Perl code
Message-Id: <7iul3d$4in$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Frank Ney <croaker@barkingmad.org> wrote:
> On 29 May 1999 23:29:31 -0000, an orbiting mind control laser caused
> Jonathan Stowe <gellyfish@gellyfish.com> to write:
> 
>>And as has been asked over and over and over and over again what do
>>*you* propose *we* do about it - shall I tie Matt Wright to a burning
>>cross on Parliament green with a sign saying 'So Die All Abusers of
>>Localtime' ?
> 
> With what has been happening over there you might consider that for your
> members of parliament...
> 

Thank you so much for applying your awesome analytical skills to the
subject of this thread.

*plonk*

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Mon, 31 May 1999 21:06:00 GMT
From: crusader@nospam.net (Why?)
Subject: Re: You can earn $50,000 40686
Message-Id: <3752f97e.78971892@news.dol.net>

On Monday, 31 May 1999 03:38:24 -0600, "MONEY" <money@moneymaker.com>
wrote:

>
>                                THE PROGRAM
>                $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
>
>                   INCREDIBLE $0 to $50,000 in 90 days!!!
>
>Dear Friend,
>
>You can earn $50,000 or more in next the 90 days sending e-mail. Seem
>impossible? Read on for details.>>

And you, Mr. Big Money maker, are spamming.


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

Date: Mon, 31 May 1999 23:47:42 +0200
From: "Kent Dahl" <MenThal@bigfoot.com>
Subject: Re: You can earn $50,000 40686
Message-Id: <7iuvt0$qb1$1@kopp.stud.ntnu.no>

Why? skrev i meldingen <3752f97e.78971892@news.dol.net>...
>On Monday, 31 May 1999 03:38:24 -0600, "MONEY" <money@moneymaker.com>
>wrote:
>>                                THE PROGRAM
>>                $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
>>                   INCREDIBLE $0 to $50,000 in 90 days!!!
>>Dear Friend
>>You can earn $50,000 or more in next the 90 days sending e-mail. Seem
>>impossible? Read on for details.>>
>
>And you, Mr. Big Money maker, are spamming.

Gah! I hate it when they don't have a valid reply adress... So much FUN to
send a reply, filling their e-mail-boxes as they do with ours.... Now, where
is that virtual memory file and how do I attach it to outgoing e-mail? ;-))

--
// =========================================================
/**  @author Kent Dahl   - stud.techn.; ind.xk. data, 1. er
  *  @url    http://www.bigfoot.com/~MenThal/
  *   { Suicide in the cyberpunk era;
  *        run a Microsoft product
  *           on your cyberspace deck. }                  */



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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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