[11262] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4862 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 10 11:07:22 1999

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

Perl-Users Digest           Wed, 10 Feb 1999     Volume: 8 Number: 4862

Today's topics:
        /usr/local/lib/perl5 no longer in @INC - Why? <gal@adv.magwien.gv.at>
        /usr/local/lib/perl5 no longer in @INC - Why? <gal@adv.magwien.gv.at>
        @ARGV can't take char =?iso-8859-1?Q?=27=F6=27?= (ascii <jakob.svensson@epk.ericsson.se>
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
    Re: About creating local filehandles <jdf@pobox.com>
    Re: Calculate yesterdays date <Peter.Webb@cern.ch>
    Re: Can't get hash to return properly. <bmb@ginger.libs.uga.edu>
        CGI/Perl Counter for MIIS panic98@Hotmail.com
    Re: Does Perl restrict regular expressions? <pdcawley@bofh.org.uk>
    Re: Does Perl restrict regular expressions? <jdf@pobox.com>
        File max. size <andrewf@beausys.demon.co.uk>
        Frustrating problem with Exporter <tomw@action.cnchost.com>
    Re: fun with strings... <Allan@due.net>
        Help editing script chall5@hotmail.com
        Help extracting Internet Address with Regular Expressio <nbeaman@msn.com>
    Re: How do I Send a form to a printer ? <Tony.Curtis+usenet@vcpc.univie.ac.at>
        How to implent a second string? <hvermeulen@correctnl.com>
    Re: how to use map for complex sort???? (Randal L. Schwartz)
    Re: newbie perl and cgi question..... <sts-admin@dont_spam_me.com>
    Re: performance penalty: bareword, single quoting, doub <bmb@ginger.libs.uga.edu>
    Re: perl floating points [benchmarking] <tbriles@austin.ibm.com>
    Re: perl x- times an equal sentence <jdf@pobox.com>
    Re: perl x- times an equal sentence simc@gmx.net
        pgperl on Solaris 2.6 <hengartn@ari.ethz.ch>
        Problem in writing the following expression in Perl k-lo@cs.yorku.ca
    Re: Question: Arrays of associative arrays (Clinton Pierce)
    Re: Question: Arrays of associative arrays (Randal L. Schwartz)
    Re: strict <ludlow@us.ibm.com>
    Re: What's wrong with this???? (Administrator)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 10 Feb 1999 16:16:31 +0100
From: Peter Reif <gal@adv.magwien.gv.at>
Subject: /usr/local/lib/perl5 no longer in @INC - Why?
Message-Id: <918659793.514240@mozart.adv.magwien.gv.at>

I wonder because I have to rewrite my scripts (including use lib
'/usr/local/lib/perl5';)

I use perl5.00502
-- 
 _____  _____ _____ _____ _____    __________.
/\  __'\\  __\\_  _\\  __\\  __'\ /\          \
\ \ \_\ \\ \_/_'\ \/ \ \_/_\ \_\ \\ \ POBODY'S \
 \ \  __/ \  __\ \ \\ \  __\\  __'.\ \ NERFECT  \
  \ \ \/ \ \ \_/_ \ \\ \ \_/_\ \'\ \\ \          \
   \ \_\  \ \____\ \_\\ \____\\_\ \_\\ \__________\
    \/_/   \/____/`/_/ \/____//_/ /_/ \/__M._Moro_/


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

Date: Wed, 10 Feb 1999 16:15:53 +0100
From: Peter Reif <gal@adv.magwien.gv.at>
Subject: /usr/local/lib/perl5 no longer in @INC - Why?
Message-Id: <918659754.984605@mozart.adv.magwien.gv.at>

I wonder because I have to rewrite my scripts (including use lib
'/usr/local/lib/perl5';)
-- 
 _____  _____ _____ _____ _____    __________.
/\  __'\\  __\\_  _\\  __\\  __'\ /\          \
\ \ \_\ \\ \_/_'\ \/ \ \_/_\ \_\ \\ \ POBODY'S \
 \ \  __/ \  __\ \ \\ \  __\\  __'.\ \ NERFECT  \
  \ \ \/ \ \ \_/_ \ \\ \ \_/_\ \'\ \\ \          \
   \ \_\  \ \____\ \_\\ \____\\_\ \_\\ \__________\
    \/_/   \/____/`/_/ \/____//_/ /_/ \/__M._Moro_/


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

Date: Wed, 10 Feb 1999 16:06:24 +0100
From: Jakob Svensson <jakob.svensson@epk.ericsson.se>
Subject: @ARGV can't take char =?iso-8859-1?Q?=27=F6=27?= (ascii dec 148)
Message-Id: <36C1A070.2FE44D1C@epk.ericsson.se>

I have some problems with the swedish character 'v' (ascii dec 148)

I'm using a CGI-script which takes arguments from a link in the form
"http://www.server.com/cgi-bin/script.pl?argument".

If the argument starts with the swedish character 'v' (lower case), the
script doesn't recognize it.

All the other swedish characters works as they should:
e ascii dec 86
E ascii dec 143
d ascii dec 84
D ascii dec 142
V (Upper case) ascii dec 99

Here is a test script which I used to test which character works and
which not, and I printed the characters direct in the browser "location"
field:

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

use CGI qw(:standard);

print header;
print start_html;

foreach (@ARGV){
	print "'";
	print "$_";
	print "'";
	print br;
	$number++;
}
print "$number/n";
print end_html;

exit;


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

Date: Wed, 10 Feb 1999 11:24:47 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage918645842.16531@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

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


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

Date: 10 Feb 1999 15:14:19 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Federico Abascal <fabascal@gredos.cnb.uam.es>
Subject: Re: About creating local filehandles
Message-Id: <m3g18el51g.fsf@joshua.panix.com>

Federico Abascal <fabascal@gredos.cnb.uam.es> writes:

> Is it possible to create a local filehandle (i.e. , inside a
> function)?

This is a FAQ, perlfaq5, "How can I make a filehandle local to a
subroutine?  How do I pass filehandles between subroutines?  How do I
make an array of filehandles?"

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


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

Date: Wed, 10 Feb 1999 15:38:07 +0100
From: Peter Webb <Peter.Webb@cern.ch>
Subject: Re: Calculate yesterdays date
Message-Id: <36C199CF.DD5E8582@cern.ch>

Thanks


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

Date: Wed, 10 Feb 1999 10:30:51 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
To: Ken Wilson <ken.wilson@home.com>
Subject: Re: Can't get hash to return properly.
Message-Id: <Pine.A41.4.02.9902101029420.42570-100000@ginger.libs.uga.edu>

On Wed, 10 Feb 1999, Ken Wilson wrote:
> In a subsequent routine I get the keys to print out but the values are
> lost.
> 
> Here is the code that's driving me up a wall.  Any assistance would be
> appreciated.

I suspect it's probably the "subsequent routine" that's doing the driving.
What's it look like?

-Brad



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

Date: Wed, 10 Feb 1999 14:12:56 GMT
From: panic98@Hotmail.com
Subject: CGI/Perl Counter for MIIS
Message-Id: <79s44u$gmj$1@nnrp1.dejanews.com>

Hello,

I dont know much about PERL or CGI but i'm looking for a CGI or PERL script
that can keep up with the number of visitors on my site. I got my own server
with my own CGI-BIN dir. Please give me some advice, and if possible also
ways to install it..

Thanks very much,

Coen Greeve

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 10 Feb 1999 12:13:06 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Does Perl restrict regular expressions?
Message-Id: <s7phfsuihil.fsf@windrush.elsevier.co.uk>

pmiker@mindspring.com (Mike) writes:

> I'm just a beginner in Unix and Perl but this one has stumped some of
> my co-workers also.  Here's the scene:
> 
> I have a log file with many records.  The last field in each record
> should contain a text message.  Some records only have blanks in this
> field.  I need to know how many records have a blank last field.  Each
> field starts and ends with a doulble-quote and fields are comma
> delimited.  Here is a command prompt statement that works
> 
> egrep '.*\"[ ]+\"$' filename | wc -l
> 
> In the perl code I have done this
> 
> $unknown = `egrep '.*\"[ ]+\"$' filename | wc -l`;

Wouldn't it be a little more perlish to do:

#!perl -w

open LOG, "<filename" or die "Can't open filename: $!";

my $unknown = 0;
while (<LOG>) { $unknown++ if /" +"$/ }
close LOG;

-- 
Where is the Life we have lost in living? 
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? 
		TS Eliot -- The Wasteland


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

Date: 10 Feb 1999 15:23:45 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Does Perl restrict regular expressions?
Message-Id: <m3d83il4lq.fsf@joshua.panix.com>

Piers Cawley <pdcawley@bofh.org.uk> writes:

> Wouldn't it be a little more perlish to do:
> 
> #!perl -w
> 
> open LOG, "<filename" or die "Can't open filename: $!";
> 
> my $unknown = 0;
> while (<LOG>) { $unknown++ if /" +"$/ }
> close LOG;

Wouldn't it be a little more perlish to do:

  perl -lne '$c++ if /somepattern/;END{print "$c\n"}' file

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


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

Date: Wed, 10 Feb 1999 12:06:04 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: File max. size
Message-Id: <EQ7fgCAsYXw2EwQ4@beausys.demon.co.uk>

I have a program which generates a log file. At present,
it appends to the file on each session, and the file just
gets larger and larger.
What I really need is to set a maximum size on this
file, but in such a way that I can still append data
to it (...and if it goes over the maximum size, the
earliest N lines are discarded).

Does anyone know of an easy way to do this ?

---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

Date: 10 Feb 1999 07:35:55 PST
From: "Tom Williamson" <tomw@action.cnchost.com>
Subject: Frustrating problem with Exporter
Message-Id: <79s90r$hv6@journal.concentric.net>

I am trying to use Exporter to give my scripts uniform access to a set of
symbols.  I am using almost exactly the same set of includes in several .CGI
files.  Sometimes the symbols are imported and sometimes they are not!!!
There seems to be no rhyme or reason to whether the imports work or not.  I
was up til 4 AM trying to get this to work so pardon me if I'm a little
grouchy.

The export script looks like:

use Exporter;
@ISA = qw(Exporter);  ##This is never explained, but it's in all the
examples
$MYSYM1 = "BLA BLA BLA";
$MYSYM2 = "I HATE PERL";
@EXPORT = qw( MYSYM1 MYSYM2 );

The importing scripts all look something like:

use mypkg::MyExports;
use myotherpkg::myotherstuff;

if ( $MYSYM2 eq 'I HATE PERL' ) {
    ## do some stuff
}

About 50% of the scripts fail on the if() statement with a "Use of
uninitialized value at line XXX" error.  But the rest work!!!!!

What the $**(&$#&$ is going on with Exporter??????  And why don't I get an
error message when it fails??  And is there an easier way to do this
(provide global values?)  The Perl documentation is completely inscrutable
on this point (and yes, I DID RTFM).

Thanks to anybody that can figure this one out...

Tom















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

Date: Wed, 10 Feb 1999 09:37:30 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: fun with strings...
Message-Id: <79s57i$i9i$1@camel0.mindspring.com>

Ronald J Kimball wrote in message
<1dmzir6.14u24bmk0l37kN@bay2-161.quincy.ziplink.net>...
:Marcos <alves@webmetro.com> wrote:
:> I need to be expand the \n and \t sequences to actual newlines and tabs.
:s/(\\[nt])/"\"$1\""/gee;


Can't resist:  gee that's cool.

AmD






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

Date: Wed, 10 Feb 1999 14:25:24 GMT
From: chall5@hotmail.com
Subject: Help editing script
Message-Id: <79s4s8$h9d$1@nnrp1.dejanews.com>

Could anyone do me a major favour please ?  I have found this script to
add,modify,delete and search a plain text file on the www.perl.com site and
it does exactly what I need it to.  I have got it working and have found when
I put a form on a web page to search the database then enter criteria and
press ENTER *instead* of clicking "Search" the add,delete,modify,search
console is displayed which is not what I want the users of the webpage to see
!  This is because the browser does not pass the search criteria when ENTER
is pressed.

I did think of disabling the ENTER button but that is proving problematic and
I realised that the user would only have to view my HTML to get the URL to
see the add,delete,modify,search console anyway.

Because of all this I need to extract the search parts from the script and
package it up in a separate "search.pl" script.  This would enable me to
administer the database separately from the users searching searching it and
prevent them from accessing the add,modify,search and delete console.

The code for the script is here :
http://webreview.com/98/10/23/perl/database.txt

I would be so grateful if someone could extract the search bits and package
them up in to a search.pl file and send it to me.  A lot to ask I know but I
get the impression that the Perl community are a pretty helpful bunch judging
from responses I have had in the past.

Any help very gratefully appreciated

Chris


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Feb 1999 08:43:00 -0500
From: "Nelson Beaman" <nbeaman@msn.com>
Subject: Help extracting Internet Address with Regular Expression.
Message-Id: <OxwpUrPV#GA.248@upnetnews02.moswest.msn.net>

I am trying to extract an Internet address (i.e. beaman@hboi.edu) from a
string by using pattern matching - with little success.  I know someone has
figured this out.  Please help!

ntb
Beaman@hboi.edu




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

Date: 10 Feb 1999 13:22:05 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: How do I Send a form to a printer ?
Message-Id: <83g18ea1oy.fsf@vcpc.univie.ac.at>

Re: How do I Send a form to a printer ?, Jim
<kf4dmb@camcomp.com> said:

Jim> I am building a Help desk app . I would like
Jim> users when the fill the form out and press a
Jim> button they send it to the help desk printer.

and the perl relevance is...?

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 10 Feb 1999 13:27:18 GMT
From: "Henry Vermeulen" <hvermeulen@correctnl.com>
Subject: How to implent a second string?
Message-Id: <79s1fm$472@news3.euro.net>

Hi to you all.
I need a hand with this piece of a search engine.
Only links build whith <A HREF are followed.
But i have a lot of pulldown menus with <OPTION VALUE.
I,m working on this for about 3 days but due the fact im a perl minor it
won't work.
a href or option value but not both.
What do i need to do to make it work?

regards Henry

sub get_href {
   my($file) = @_;
   my ($i, $link, $url, $page);
   my(@links) ;
   my(@lnks);

   $page = &readFile($file);
   @links = split(/<A[\s]+HREF[\s]*=[\s]*/i, $page);
   foreach $i (1..$#links) {
      $link = $links[$i];
      if ($link =~ /^\"?([^>\"\s]*)\"?/) {
   push(@lnks, $1);
      }
   }
   return @lnks;
}

sub readFile {
   my($file) = @_;
   local(*FH);
   my(@page);
   my($string);

   open (FH, $file) || warn "Cannot open file $file: $@";
   @page = <FH>;
   close FH;
   $string = join("",@page);
   return $string;
}




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

Date: 10 Feb 1999 06:03:13 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: how to use map for complex sort????
Message-Id: <m1btj2nyou.fsf@halfdome.holdit.com>

>>>>> "Daniel" == Daniel Grisinger <dgris@moiraine.dimensional.com> writes:

Daniel> vroom@cs.hope.edu (Timothy Vroom) writes:
>> I need to do a complicated sort in which I split the strings in the array
>> which are separated by : then I sort on the addition between the second and
>> third fields
>> 
>> an example string stored in the array would be 123450678:12:1 

Daniel> You need a Schwartzian Transform.

Daniel> @sorted = map { $_ -> [0] }
Daniel>           sort { $a -> [1] <=> $b -> [1] }
Daniel>           map { [ $_ -> [0], $_ -> [2] + $_ -> [3] ] }
Daniel>           map { [ $_, split /:/, $_ ] } @unsorted;

Well, if you're gonna do it my way, it'd be:

@sorted =
	map { $_->[0] }
	sort { $a->[1] <=> $b->[1] }
	map { my @x = split /:/; [$_, $x[2]+$x[3]] }
	@unsorted;

I bet that'll benchmark significantly faster for large datasets.

print sort "Just ", "anoth", "er Pe", "rl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 10 Feb 1999 12:28:44 -0000
From: "sys admin" <sts-admin@dont_spam_me.com>
Subject: Re: newbie perl and cgi question.....
Message-Id: <79rtt3$8jb$1@newsreader3.core.theplanet.net>

>I hope not... I would hope that a sysadmin would at least know how to do
>some simple 'printf school' debugging, and to read documentation and thus
>not reinvent the wheel...

please, if i'd wanted insulting, i'd have gone home to my children.

>($key,$value) = ( split(/=/, $query_string[$index]) || die "died ..." );
>
>That has the effect of putting the split into a scalar context. So as the
>documentation says :
>
>If not in list context, returns the number of fields found and splits into
>the @_ array.

ok, thats good, i've learned something.....
>
>Thus $key gets assigned 2 and $value gets undef.
>
>A couple of print statements would have revealed this to you in a few
seconds.
>

yes, I did exactly what you are suggesting and got the same results as shown
above.
I realised that $key this was the number of splits,
however I did not know as i stated in my original post,
why it was not behaving as I expected. You have now enlightened me....


=======






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

Date: Wed, 10 Feb 1999 10:29:22 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: performance penalty: bareword, single quoting, double quoting
Message-Id: <Pine.A41.4.02.9902101013340.42570-100000@ginger.libs.uga.edu>

On Wed, 10 Feb 1999, Ronald J Kimball wrote:
> What Brad meant to say was:
> 
> I like barewords in those places where perl doesn't complain about
> them. Actually, -w doesn't complain about lower-case barewords **as hash
> keys**.
> 
> In other words, -w will not complain about things such as $x{foo}.
> 
> :-)

Yes, that's exactly what I meant.  In fact, I use barewords in hash keys
*only* (as well as to the left of '=>').  I would *not* use them anywhere
else.  I have been assuming that -w would complain about all bare words
that were not hash keys (or left of =>).  Obviously, I have been wrong.

Cheers!  -Brad



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

Date: Wed, 10 Feb 1999 08:34:41 -0600
From: Tom Briles <tbriles@austin.ibm.com>
Subject: Re: perl floating points [benchmarking]
Message-Id: <36C19900.C3EAC0A5@austin.ibm.com>

Ilya Zakharevich wrote:

> About your subject: Perl has only one floating point, and it is
> allowed to float upwards only.  This point, though a scarce resource,
> is very useful to implement the bubble sort algorithm, one which is
> used when you do sort(@array) in Perl.
>
> In fact it is quite interesting to listen to these tiny bubbles
> created when this point floats upward (you need to have a pretty big
> @array for the sound to be above the ear threshold).  What I always
> was interesting in is how the speed of sort algorithm depends on
> having a desktop case vs. a tower case (with the same processor).  I
> would think that bubbles may accelerate to much higher speed given a
> tower case.
>
> Anybody ready for a benchmark?
>
> Ilya

Actually, from my testing, it depends (as is generally the case with
benchmarks).

If a single array is being bubble sorted, the tower is much faster - but if you
code your program such that many arrays are sorted in parallel, the desktop will
win out.  EACH array sorted in parallel takes longer on the desktop, but the
TOTAL time for all sorts is less.

I'm currently working on an article for submission to TPJ.

- Tom




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

Date: 10 Feb 1999 15:11:37 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: simc@gmx.net
Subject: Re: perl x- times an equal sentence
Message-Id: <m3iudal55y.fsf@joshua.panix.com>

simc@gmx.net writes:

> the command 'print SFILE "xyz";' print 'xyz' x- times (where x is
> the count of the existing sentences), after this operation i have so
> x- times the equal sentence in the file.

It's impossible to know why you're having that problem unless you show
us the code--not the whole program, but the lines that deal with
opening, writing to, and closing the file.

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


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

Date: Wed, 10 Feb 1999 14:49:46 GMT
From: simc@gmx.net
Subject: Re: perl x- times an equal sentence
Message-Id: <79s6a7$igm$1@nnrp1.dejanews.com>

In article <79rj77$2k8$1@nnrp1.dejanews.com>,
  simc@gmx.net wrote:
> hi all ...
>
> i 've a problem with perl: when i want to attache (>>) a sentence to a
> existing file, the command 'print SFILE "xyz";' print 'xyz' x- times (where x
> is the count of the existing sentences), after this operation i have so x-
> times the equal sentence in the file. does someone have an idea that is
> situated?
>
> thanx
>
> simc
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

to Jonathan Feinberg:
here is the source code of the part:

$save_file = "student.dat";
$SAVEFILE = "STDDAT";

open($SAVEFILE, ">>$save_file");
print $SAVEFILE "$name]$email]$school]$location]";
print $SAVEFILE "$vday]$vmonth]$vyear]$bday]$bmonth]$byear\n";
close($SAVEFILE);

 ... in another script functions it ...

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 10 Feb 1999 13:44:12 +0100
From: Urs Hengartner <hengartn@ari.ethz.ch>
Subject: pgperl on Solaris 2.6
Message-Id: <36c17f1c.0@pfaff.ethz.ch>

Did anyone succeed in installing pgperl on a Solaris 2.6
machine? I keep getting the following error message when
calling 'make test':

PERL_DL_NONLAZY=1 /pub/perl/5.00401/bin/perl -I./blib/arch -I./blib/lib -I/pub/perl/5.00401/lib/sun4-solaris/5.004 -I/pub/perl/5.00401/lib test.pl
Default Device for plot tests [recommend /XSERVE] ?
============== Running test1.p ==============
Can't load './blib/arch/auto/PGPLOT/PGPLOT.so' for module PGPLOT: ld.so.1: /pub/perl/5.00401/bin/perl: fatal: relocation error: file /home/hengartn/lib/solaris/pgplot/libpgplot.so: symbol s_wsfi: referenced symbol not found at /pub/perl/5.00401/lib/sun4-solaris/5.004/DynaLoader.pm line 155, <STDIN> chunk 1.  

I tried Perl 5.00401, 5.00404, and 5.00502, and I always get the
same error.

- Urs



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

Date: Wed, 10 Feb 1999 15:24:56 GMT
From: k-lo@cs.yorku.ca
Subject: Problem in writing the following expression in Perl
Message-Id: <79s8bs$khr$1@nnrp1.dejanews.com>

I have loaded a database into the system as a background, commands to the db
are written in the command line. I find difficulty while I tried to write the
following command using Perl.

  db2 create tablespace tspace1 managed by system using ('con1', 'con2',
'con3')

Note: the brackets and quotes are essential.

Any help will be appreciated...

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 10 Feb 1999 14:50:20 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: Question: Arrays of associative arrays
Message-Id: <36d09a44.677897627@news.ford.com>

On Tue, 09 Feb 1999 15:37:51 -0600, James Ludlow <ludlow@us.ibm.com>
wrote:
>Ok.  It still has the basic documentation and the faq.  I don't see how
>not providing binaries makes it any less useful for reading about Perl
>syntax.

Simply that, in days of old I'd simply give my students the one URL
(www.perl.com) and just have them use that as a general-purpose Perl
Portal.)

Now that perl.com is more firmly in ORA's grip, they've "trimmed"
pointers to non-ORA resources (consultants, Activestate, etc...).  I
find myself being _very_ specific about trying to indicate which
resources may be tainted in which directions, and which resources are
clearly better than others.

[Not an ORA flame at all!  (I own 15 ORA books.)  ORA is a business,
"www.perl.com" is clearly a tool used for business purposes, and Tim
O'Reilly is hardly a pure Altruist.  Draw your own conclusions.]  


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

Date: 10 Feb 1999 07:44:49 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Question: Arrays of associative arrays
Message-Id: <m1g18emff2.fsf@halfdome.holdit.com>

>>>>> "Clinton" == Clinton Pierce <cpierce1@ford.com> writes:

Clinton> Simply that, in days of old I'd simply give my students the one URL
Clinton> (www.perl.com) and just have them use that as a general-purpose Perl
Clinton> Portal.)

Clinton> Now that perl.com is more firmly in ORA's grip, they've "trimmed"
Clinton> pointers to non-ORA resources (consultants, Activestate, etc...).  I
Clinton> find myself being _very_ specific about trying to indicate which
Clinton> resources may be tainted in which directions, and which resources are
Clinton> clearly better than others.

Clinton> [Not an ORA flame at all!  (I own 15 ORA books.)  ORA is a business,
Clinton> "www.perl.com" is clearly a tool used for business purposes, and Tim
Clinton> O'Reilly is hardly a pure Altruist.  Draw your own conclusions.]  

That probably means that The Perl Institute should then continue to
pick up the slack, quite possibly making www.perl.org the predominant
"portal" as it was intended.  That's why I created TPI in the first
place -- to handle those central tasks that fell in the gap between
existing projects, and to serve as a catalyst so that others *would*
pick up projects.  And it's actually done quite well at that.

I suppose we need more volunteers if we are to do that.  Go see
www.perl.org about where to sign up.

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 10 Feb 1999 09:41:59 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: strict
Message-Id: <36C1A8C7.15C5D3FD@us.ibm.com>

Daniel Grisinger wrote:
> 
> " -=:Paul Coleman:=-" <Paul.Coleman@CoSeCo.com> writes:
> 
> > Not if you don't know what "perldoc strict" means, then it is incomplete and
> > incorrect as it has done less than the post post.  For it to be complete and
> > correct it would have to include meaningful instructions as to it's use.
> > the words "perldoc strict" standing by them self are meaningless, especially
> > to a beginner that does not now what "strict" is.
> 
> No, it's only meaningless to the beginner if that person doesn't know
> and can't figure out what `perldoc' is.  And, to be honest, a person
> who can't figure out what perldoc is in three guesses or less probably
> shouldn't be trying to program.  Call it an entrance requirement.

I'll second that.  If you can't figure out 'man perldoc', you've got a
bit more to learn before you start digging into a programming language. 
I think that in a specialized group like clpm, we should be able to
assume at least a basic level of computer literacy.

-- 
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)


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

Date: Wed, 10 Feb 1999 14:30:55 +0100
From: EMAG-Herzberg@t-online.de (Administrator)
Subject: Re: What's wrong with this????
Message-Id: <36C18A0F.2301DE3D@emag.de>

Dean Darlison wrote:
> 
> Administrator wrote:
> 
> > I programmed this to do some syslog output, but nothing showed up on the
> > syslog screen (tty12)... what's wrong?
> >
> > ------------------------------
> > ...
> > ------------------------------
> >
> Don't know much about the syslog module. but you could try logger(1) to
> verify that your syslog configuration,
> syslog.conf, is doing what you think it is .

Yes, logger works fine. the syslog.ph files are installed fine with
h2ph, too - but still, nothing shows up on tty12 when syslogging from
perl ...


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

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

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