[12505] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6105 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 23 06:07:18 1999

Date: Wed, 23 Jun 99 03:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Jun 1999     Volume: 8 Number: 6105

Today's topics:
    Re: 2 simple (not to me tho) questions (Olivier Dehon [8026867])
    Re: 2 simple (not to me tho) questions <tchrist@mox.perl.com>
    Re: 2 simple (not to me tho) questions (Eric Bohlman)
    Re: [q] Timing of a simple looping cycle PERL vs C (Larry Rosler)
    Re: [q] Timing of a simple looping cycle PERL vs C <tchrist@mox.perl.com>
    Re: A buggy intersection-method <tchrist@mox.perl.com>
    Re: AIX, sar and perl (what am I doing wrong?) <stefan@fos.su.se>
        ANNOUNCE: PUBcrawl newsletter <andrew-johnson@home.com>
    Re: Can someone help me on this challenging problem? (Abigail)
    Re: can you split a word into letters? (Michael Stillwell)
    Re: can you split a word into letters? (Larry Rosler)
    Re: can you split a word into letters? (Michael Stillwell)
    Re: can you split a word into letters? (Michael Stillwell)
    Re: can you split a word into letters? (Bart Lateur)
    Re: CGI.pm versus twelve or so lines of code.... (Bart Lateur)
        Comparing two associative arrays <vinayak@india.ti.com>
    Re: Does Perl have a future? <matt.sergeant@ericsson.com>
    Re: Help! Perl script needed to remove the first line o (Marcel Grunauer)
    Re: Language choice for high-volume Oracle CGI interfac <matt.sergeant@ericsson.com>
        Looking for coverage and complexity tools <fenster@compugen.co.il>
    Re: NDS perl <gellyfish@gellyfish.com>
        Newbie- foreach $var (keys %fields) - Outputs in wrong  <khan@arcom.com.au>
    Re: Perl and Personal Web Server (Win98) <dave@dave.org.uk>
    Re: Statistics for comp.lang.perl.misc (Abigail)
    Re: Summing an array <dave@dave.org.uk>
    Re: Summing an array <rra@stanford.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 23 Jun 1999 09:38:04 +0100
From: odehon@in-csg58.uk.jpmorgan.com (Olivier Dehon [8026867])
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <iux4sjzqplf.fsf@in-csg58.uk.jpmorgan.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

> They aren't harmless, you know.  Double quoted compose a
> *brand*new*string*.  This isn't necessarily what you always want.

What about double-quoted strings where no interpolation is needed?
Is that a bad practice and should one use single quotes instead?

Or is the perl compiler/interpreter clever enough to not try and
interpolate a constant string at run-time?

-Olivier


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

Date: 23 Jun 1999 03:21:39 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <3770a723@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    odehon@in-csg58.uk.jpmorgan.com (Olivier Dehon [8026867]) writes:
:> They aren't harmless, you know.  Double quoted compose a
:> *brand*new*string*.  This isn't necessarily what you always want.
:
:What about double-quoted strings where no interpolation is needed?
:Is that a bad practice and should one use single quotes instead?
:Or is the perl compiler/interpreter clever enough to not try and
:interpolate a constant string at run-time?

Well, I think it's probably ok, but the script kiddies do screw things
up a lot with their insane "c:\foo\bar" formfeeds and backspaces.
Then again, script kiddies screw up everything, so this is of 
low concern.

Why might someone use "fred" rather than 'fred'?  C programmers tend
to automatically use "fred" when they think string.  A better argument
might be that the double quotes stand out better to the reader's eye,
especially when single quotes get mangled into weird fonts.

You will be hard-pressed to extract a meaningful timing difference
between them.  It appears to be not more than 1%.

    use Benchmark;

    timethese 2_000_000 => {
	single => sub { $x = 'fred was here' },
	double => sub { $x = "fred was here" },
    }

    Benchmark: timing 2000000 iterations of double, single...
	double:  7 wallclock secs ( 6.52 usr +  0.00 sys =  6.52 CPU)
	single:  7 wallclock secs ( 6.46 usr +  0.00 sys =  6.46 CPU)

--tom
-- 
If I had any humility I would be perfect.
                --Ted Turner


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

Date: Wed, 23 Jun 1999 09:46:00 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <ebohlmanFDrxso.6x2@netcom.com>

Olivier Dehon [8026867] (odehon@in-csg58.uk.jpmorgan.com) wrote:
: What about double-quoted strings where no interpolation is needed?
: Is that a bad practice and should one use single quotes instead?

It's purely a matter of style.  Many people, myself included, prefer to 
use double quotes only when interpolation is needed or for null strings 
(because '' looks too much like a single double quote in many fonts).  
The idea is that if you're looking at your own code from a while back, 
you can quickly skip over anything in single quotes because you know that 
it's a true constant, whereas you do have to read inside a double-quoted 
string to tell what you're going to get.



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

Date: Wed, 23 Jun 1999 01:27:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: [q] Timing of a simple looping cycle PERL vs C
Message-Id: <MPG.11da3a3fdbaa4369989c2d@nntp.hpl.hp.com>

In article <7kpu98$nqg$1@monet.op.net> on Wed, 23 Jun 1999 06:19:59 GMT, 
Mark-Jason Dominus <mjd@op.net> says...
 ...
> Here's an example of the depth of the authors' ignorance:  In the
> original version of the paper (since corrected) they presented a Perl
> program ``to copy input to output, uninterpreted and unexamined, like
> the Unix cat command.'' Here is the program they timed:
> 
>         while (<>) {
>           chop;
>           print $_;
>         }
> 
> The correct, chopless version ran about 25% faster.

Imagine if it were done even better, using sysread and syswrite!

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


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

Date: 23 Jun 1999 02:43:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [q] Timing of a simple looping cycle PERL vs C
Message-Id: <37709e2d@cs.colorado.edu>

In comp.lang.perl.misc, 
    ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
:Generally, you perform much better when discussing topics within your
:grip.  Why won't you restrict yourself to these domains?

I AM WITHIN MY DOMAIN YOU STUPID GIT.  Why don't you get a grip, Ilya,
and stop spreading lies?  You're fucking lying, and I'm fucking tired
of it.  Overall, real-world perl performance is nothing at all like your
pathological snippets.  This has been proven time and time again.

*PLONK*

--tom
-- 
> (It's sorta like sed, but not.  It's sorta like awk, but not.  etc.)
  Guilty as charged.  Perl is happily ugly, and happily derivative.
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: 23 Jun 1999 02:46:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: A buggy intersection-method
Message-Id: <37709ecf@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    bart.lateur@skynet.be (Bart Lateur) writes:
:Yup. Plus saving $ARGV (the current filename) at the same time. But, it
:doesn't work.

It's a bug.

--tom
-- 
Welcome to Microsoft!
Plase set your watch back 20 years.


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

Date: Wed, 23 Jun 1999 09:36:25 +0000
From: Stefan Lindberg <stefan@fos.su.se>
Subject: Re: AIX, sar and perl (what am I doing wrong?)
Message-Id: <3770AA98.398D31B3@fos.su.se>

Quick and easy:

Insert this somewhere at the beginning of your script.

# Begin code
$oldhandle = select(FILEHANDLE);
# This line will make FILEHANDLE flush after each line
# if separator is \n which it normally is
$| = 1;
# Make stdout standard filehandle again
select($oldhandle);
# End code

/S. Lindberg

jgruiz1@ibm.net wrote:

> I have the following perl script. Which is supposed to execute
> the UNIX 'sar' command, descard any header information from the
> sar output and save the performance data in an output file.
>
> The script works, but it never saves data to the output file
> "sar.out" until the close(SARF) gets executed. What should I
> do to save data to the output file after every sample (line)?
>
> Any ideas?? by the way, I am running perl 5.004_04 under AIX
> 4.3.2.
>
> Thanks,
> Juan
>
> ----- script starts here -----
> #!/usr/bin/perl
>
> use FileHandle;
>
> sub collect_sar
> {
>   my($samples,$interval,$outf)=@_;
>   open(SARF,">$outf");
>   autoflush SARF;
>   @fargs=("/usr/sbin/sar",$interval,$samples);
>   open(SAR,"@fargs|");
>   autoflush SAR;
>
>   while(<SAR>) {
>     if ( /^\d\d:\d\d:\d\d\s+\d+\s+\d+\s+\d+\s+\d+/ ) {
>       print SARF $_;
>     }
>   }
>   close(SAR);
>   close(SARF);
> } # end collect_sar
>
> &collect_sar(15,5,"sar.out");
>
> ----- script ends here -----
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



--
============= FOOS - Chemistry ====================
Stockholm University   URL: www.fos.su.se/~stefan/
FOOS - Chemistry       Phone: +46 8 674 7481
Stefan Lindberg        Cell:  +46 70 491 0223
S-106 91 Stockholm     Office: Arrhenius,c454
          E-Mail: stefan@fos.su.se
      Get PGP public key at my homepage
===================================================





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

Date: Wed, 23 Jun 1999 08:51:55 GMT
From: Andrew Johnson <andrew-johnson@home.com>
Subject: ANNOUNCE: PUBcrawl newsletter
Message-Id: <3770A078.8F80804E@home.com>

Announcing PUBcrawl Issue 01:
----------------------------

We here at Winnipeg.pm are attempting to start up a new, free
Perl publication as a forum for publishing source code in the
style of Literate Programs (using noweb syntax).

    For LP and noweb info see:
        http://shelob.ce.ttu.edu/daves/faq.html
        http://www.cs.virginia.edu/~nr/noweb/

Rather than delay the first issue any longer (stuff happens) we have 
decided to release the first trial issue. Consider it something of
a prototype or proof of concept if you will. We hope you like it, or
at least see some potential in it, and decide to contribute to a
future issue (we do not intend [nor want] this to be just a
Winnipeg.pm thing, we are merely getting the ball rolling). Comments
always welcome.

This first issue is a little rough around the edges as we are still
working out some formatting and editorial details.

Where?

All issues will be freely available and free of charge. Find out
more, and grab a postscript or PDF copy at:

    http://winnipeg.pm.org/newsletter/

(note, the PDF is converted from the postscript and suffers a
little in quality ... I'm experimenting with other conversion
methods).

Aside from a few tidbits in the front section there are
4 feature articles in this issue:

    - faqgrep: A Jumpstart Perl Script
    - sdist: Building script distributions
    - pqtangle: Tangling with Perl Code
    - Brewing Up Some Perl: Browser Based Abstract 
      Database Access

Sources for the programs are available as a tarball at the above
mentioned site, including a pre-tangled version of pqtangle for
tangling out the code from the other article sources (see the readme
file in the tarball).

Enjoy,
andrew


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

Date: 23 Jun 1999 03:11:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Can someone help me on this challenging problem?
Message-Id: <slrn7n15l9.k1b.abigail@alexandra.delanet.com>

plz_reply_to_group (none@microsoft.com) wrote on MMXCVI September
MCMXCIII in <URL:news:374EFDD9.E7802C23@microsoft.com>:
() Check out the Algorithm of the Gods, at
() http://web2.thesphere.com/SAS/SciAm/1997/SimAneal/SimAneal.html. It is
() the elaboration of an article from Scientific American magazine, March,
() 1997, about an algorithm for solving traveling-salesman-type problems.
() It's a really good article, in fact the web site is one of the best on
() the net. Really.


Except that the problem has nothing to do with TSP. It's a trivial
problem, typical given in the first semester of a CS program as a
homework problem. A modification of Dijkstra's algorithm will work.



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== 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: 23 Jun 1999 08:16:55 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: can you split a word into letters?
Message-Id: <slrn7n15vn.4st.mist@fangorn.cs.monash.edu.au>

In article <slrn7n132j.k1b.abigail@alexandra.delanet.com>, Abigail wrote:
: Abigail (abigail@delanet.com) wrote on MMCXXII September MCMXCIII in
: <URL:news:slrn7n12lc.k1b.abigail@alexandra.delanet.com>:
: () Michael Stillwell (mist@yoyo.cc.monash.edu.au) wrote on MMCXXII September
: () MCMXCIII in <URL:news:slrn7n1081.2a1.mist@fangorn.cs.monash.edu.au>:
: () "" In article <slrn7n0qmb.k1b.abigail@alexandra.delanet.com>, Abigail wrote:
: () "" 
: () "" : The above benchmark is fine if you want to benchmark "how to find the
: () "" : first character of a string". It's bloody pointless in benchmarking
: () "" : "the equivalent of chop() that removes from the beginning of the string".
: () "" 
: () "" In a similar vein, is the following a bullet-proof equivalent of chomp
: () "" that returns the chomp'ed value?
: () "" 
: () ""   sub champ {
: () ""   
: () ""     my @a = @_;
: () "" 
: () ""     chomp @a;
: () ""     return @a;
: () "" 
: () ""   }
: () 
: () No, as C<champ> doesn't do the equivalent of C<chomp>.
: () (That is, operate on $_.)
: 
: And far worse, champ doesn't *modify* its arguments, like chomp does. Duh!

For my purposes, this is a feature; I want a chomp that works like a
"regular function".  To fix the first problem, how about this:

  sub champ {
  
    my @a = @_ || ( $_ );
    
    chomp @a;
    return @a;
    
  }


Michael

-- 
 .. ABSOLUT .SIG. ..
 .. Michael Stillwell ..
 .. mist@yoyo.cc.monash.edu.au ..
 .. http://yoyo.cc.monash.edu.au/~mist/ ..


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

Date: Wed, 23 Jun 1999 01:18:57 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: can you split a word into letters?
Message-Id: <MPG.11da38368215c063989c2c@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <slrn7n1081.2a1.mist@fangorn.cs.monash.edu.au> on 23 Jun 1999 
06:38:58 GMT, Michael Stillwell <mist@yoyo.cc.monash.edu.au> says...
 ...
> In a similar vein, is the following a bullet-proof equivalent of chomp
> that returns the chomp'ed value?

<SNIP>

> I want this because I prefer to do
> 
>   my $hostname = champ(`hostname`);
>   
> instead of
> 
>   my $hostname;
>   chomp($hostname = `hostname`);

    chomp(my $hostname = `hostname`);

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


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

Date: 23 Jun 1999 08:34:42 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: can you split a word into letters?
Message-Id: <slrn7n1712.5al.mist@fangorn.cs.monash.edu.au>

In article <slrn7n15vn.4st.mist@fangorn.cs.monash.edu.au>, Michael Stillwell wrote:

To continuing the trend of following up to your own post:

:   sub champ {
:   
:     my @a = @_ || ( $_ );

For reasons I don't quite understand, this line should be

      my @a = @_ ? @_ : ( $_ );
      
:     chomp @a;
:     return @a;
:     
:   }



Michael

-- 
 .. ABSOLUT .SIG. ..
 .. Michael Stillwell ..
 .. mist@yoyo.cc.monash.edu.au ..
 .. http://yoyo.cc.monash.edu.au/~mist/ ..


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

Date: 23 Jun 1999 08:41:06 GMT
From: mist@yoyo.cc.monash.edu.au (Michael Stillwell)
Subject: Re: can you split a word into letters?
Message-Id: <slrn7n17d2.5fq.mist@fangorn.cs.monash.edu.au>

On Wed, 23 Jun 1999 01:18:57 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
: [Posted and a courtesy copy sent.]
: 
: In article <slrn7n1081.2a1.mist@fangorn.cs.monash.edu.au> on 23 Jun 1999 
: 06:38:58 GMT, Michael Stillwell <mist@yoyo.cc.monash.edu.au> says...
: ...
: > In a similar vein, is the following a bullet-proof equivalent of chomp
: > that returns the chomp'ed value?
: 
: <SNIP>
: 
: > I want this because I prefer to do
: > 
: >   my $hostname = champ(`hostname`);
: >   
: > instead of
: > 
: >   my $hostname;
: >   chomp($hostname = `hostname`);
: 
:     chomp(my $hostname = `hostname`);

For some reason, I didn't think this was possible (does it only work
in very recent versions of perl?) but I still don't particularly like
this solution, because I'd prefer to write:

  my $username = $ENV{"USER"};
  my $hostname = champ(`hostname`);

than

  my $username = $ENV{"USER"};
  chomp(my $hostname = `hostname`);
  
To my eye, the first way looks nicer---especially if a number of
variables need to be set.



Michael

-- 
 .. ABSOLUT .SIG. ..
 .. Michael Stillwell ..
 .. mist@yoyo.cc.monash.edu.au ..
 .. http://yoyo.cc.monash.edu.au/~mist/ ..


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

Date: Wed, 23 Jun 1999 08:50:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: can you split a word into letters?
Message-Id: <37709f3a.396228@news.skynet.be>

Michael Stillwell wrote:

>:     my @a = @_ || ( $_ );
>
>For reasons I don't quite understand, this line should be
>
>      my @a = @_ ? @_ : ( $_ );

Context. || works using scalar context. You can't use @_ both in scalar
and in list context at the same time, which is what you'd need in order
to get @_'s elements.

BTW does this indeed allow to change $_? I'd think not.

	Bart.


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

Date: Wed, 23 Jun 1999 07:57:42 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: CGI.pm versus twelve or so lines of code....
Message-Id: <37799297.5998139@news.skynet.be>

hiro wrote:

> CGI.pm versus twelve or so lines of code....

Then create your own module. I did. Extract only the stuff you need from
CGI.pm, throw in some other stuff you always need (such as for example
HTML::entities), and you've got a robust, fastloading, generic CGI-lite
module.

	Bart.


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

Date: 23 Jun 1999 13:34:13 +0530
From: Vinayak P DAs <vinayak@india.ti.com>
Subject: Comparing two associative arrays
Message-Id: <sy5r9n35on6.fsf@india.ti.com>

Hi,

 Wanted to know if there is any way to directly compare two hashes.

 What I want to do is

 if ( %hash1 == %hash2 ){

 ..... do something

 }

 Is there any such operations which will compare key , value pairs for
 two associative arrays directly.

Regards.
Vinayak

 _ _  _  _ _  ___  _ _  ___  _ __     ___  ___  ___ 
| | || || \ || . || | || . || / /    | . \| . |/ __>
| ' || ||   ||   |\   /|   ||  \     | | ||   |\__ \
|__/ |_||_\_||_|_| |_| |_|_||_\_\    |___/|_|_|<___/
----------------------------------------------------------------------
APDC India   vinayak@ti.com    91-80-5099157
----------------------------------------------------------------------
Certainly there are things in life that money can't buy, but it's very
funny-- Did you ever try buying them without money? -- Ogden Nash

 


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

Date: Wed, 23 Jun 1999 09:28:43 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Does Perl have a future?
Message-Id: <37709ABB.5FC3501@ericsson.com>

Joe Chan wrote:
> 
> Are these criticisms valid? If so are they also true of Java Servlets
> and Java Server Pages? Is mod_perl a viable facility for ISP's to
> supply to subscriber's homepages or is it more suited to Corporate
> Intranets or larger web sites running their own servers?

Along with the points others have made, I think the core issue is
mod_perl for ISP's for people uploading their own scripts. I don't think
it's really a viable proposition, because there are certain things you
need to consider:

A badly written mod_perl script can bring a server to it's knees. There
are wrappers available to prevent this for CGI - I don't know about
mod_jserv.

mod_perl scripts run under the same permissions as the web server,
unlike a properly wrapped CGI script on an ISP's server (e.g. mine run
under my own user account's permissions, so I can't destroy other
people's web space).

Module updates (*.pm files) require a server restart, and
PerlFreshRestart to be turned on. Both of these are bad things for an
ISP. Perl script updates don't require a restart, but who doesn't
modularise their code?

I'm sure there are other points too.

One option it to persuade your ISP to allow you to run a separate httpd
on another port that runs mod_perl, and have mod_rewrite redirect all
mod_perl requests to your separate server. That way the ISP can monitor
your usage using standard unix process limiting tools. Good luck if you
go that route - ISP's aren't normally that flexible.

Matt.


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

Date: Wed, 23 Jun 1999 09:15:25 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Help! Perl script needed to remove the first line of a file
Message-Id: <3771a596.1784746@enews.newsguy.com>

On Wed, 23 Jun 1999 06:25:06 GMT, moon@zeus.atu.com.au wrote:

>Lets say we have a $file ..
>i want it to run the first line of the file, or extract the first line,
>when thats been done i want it to remove that line.
>
>An addition to this would be to insert a line (or more) to the end of
>the file.
>
>soo..
>all in all, a script that will get line1 from $file, remove it .. while
>another perl script is inserting a LINE at the end of the $file.
>
>Help on this would be muchly appreciated.

perlfaq5: How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the beginning of
a file?


Marcel



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

Date: Wed, 23 Jun 1999 09:45:08 +0100
From: Matt Sergeant <matt.sergeant@ericsson.com>
Subject: Re: Language choice for high-volume Oracle CGI interface?
Message-Id: <37709E94.3A1FC6FB@ericsson.com>

Lee Fesperman wrote:
> 
> Matt Sergeant wrote:
> >
> > Lee Fesperman wrote:
> > >
> > > Actually, there are a lot of disadvantages to using a 'subset' of a language for
> > > specific purpose (like using a subset of Perl for CGI). Assuming you're advocating using
> > > a subset of Perl (so you don't have to learn the full blown language), the disadvantages
> > > of that approach include:
> > >
> > > + You must clearly document this subset, carefully leaving out complexities of the
> > > language that are not needed. What to include can be a very hard choice to make.
> >
> > Why?
> 
> Why what? Try ... to enable "using a subset of Perl so you don't have to learn the full
> blown language."

Err, what's to stop you doing that anyway, as it stands right now?
Judging by the posts to clp.misc there's an awful lot of people who
learn perl without ever reading the documentation - so what's more
documentation going to do for them?

> > > + To a user of the subset, many of the elements will be counter-intuitive since they
> > > were actually designed for a larger purpose.
> >
> > Such as? Please give examples, with comparisons to how Jive does this so
> > much better. Don't limit yourself to pure perl, but consider things like
> > EmbPerl which do something very similar to Jive (without it's
> > limitations).
> 
> I gave an example before - cgi name lookup. Jive is a a different animal than Perl (even
> some specialized subset); it has tight integration with database - the language directly
> supports SQL data types, SQL nulls, SQL idioms (between, like, ...), input/output
> parameters, nested queries and more.

But sadly it doesn't support networking, system calls, OODB's, complex
data structures, persistence, etc. This leaves it rather out in the cold
for any serious work. I'm sure it's great for beginners, but what
happens when they grow beyond Jive's feature set?

[snip]

> That's exactly what I meant -- those are explicit lookups. Similiar to a C function call
> -- cgiLookup("my_form_name"). Also, the dollar sign and braces notation is hardly
> intuitive to experienced developers from other languages.

Oh come on. We could go around all day with your straw man arguments,
and I could counter-argue that your method prevents using variables that
might be the same as your form element names. But what would be the
point - these are such minor differences, and many people before you and
I have found perl to be a perfectly good fit for CGI, and so will many
after us.

> > > If you are recommending that Perl CGI is a good choice for an experienced developer in
> > > Perl, I wholeheartedly agree with you.
> >
> > s/ in Perl//;
> 
> Another notation that is rare in other languages.

Good. They miss out - not us.

> > My experience with languages limited to one problem domain is that they
> > are just that: Limited.
> 
> As if Perl was more than a scripting language! If you want general purpose, try Java (On
> topic !?!), C, Assembly.

Don't troll. There's not a whole lot Perl can't do. And anything Perl
can't do I'd be loathe to try in Java too.

Matt.









 .


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

Date: Tue, 22 Jun 1999 07:31:01 +0300
From: Yaacov Fenster - System Engineering Troubleshooting and other miracles  <fenster@compugen.co.il>
Subject: Looking for coverage and complexity tools
Message-Id: <376F1185.9F7C4022@compugen.co.il>

I am looking for tools that measure code coverage and code complexity
for perl. I found an alpha version of a code coverage tool, but nothing
more. Does anyone know of anything else (especially code complexity
analysis)? Please reply directly and I will summarize to net.

	Thank you in advance

		Yaacov
-- 
% -------------------------------------------------
% Yaacov Fenster		+972-3-765-8550
% fenster@compugen.co.il	y.fenster@ieee.org
% Policy: All e-mail messages are to be responded to (and hopefully
%         resolved) within 24 hours of reading.
% All the opinions voiced are mine alone and do not reflect the opinion
% of anyone else. (Including my employer's).


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

Date: 23 Jun 1999 10:29:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NDS perl
Message-Id: <3770a8dd@newsread3.dircon.co.uk>

John L Freeze <freezej@bms.com> wrote:
> Is anyone using perl to manipulate the nds tree????
> 

There is a (Commercial) module available that will enable you to access
NDS objects - I downloaded it once but buggered if I can remember where
from - alternatively you can access NDS  (from windows) using the ODBC
driver that you can download from <http://developer.novell.com> .

/J\
-- 
"Report accuses Royal Opera House of 'arrogance and elitism'. Report
further alleges that Pope is Catholic. Report further claims that bears
may well indeed defecate in the woods" - Private Eye


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

Date: Wed, 23 Jun 1999 17:49:56 +0930
From: Kevin Hancock <khan@arcom.com.au>
Subject: Newbie- foreach $var (keys %fields) - Outputs in wrong order ?????
Message-Id: <377098AC.9F127A45@arcom.com.au>

Hi

Tryin g to write my first Perl script and so far so good. everything is
working OK except the output from "foreach $var (keys %fields)" is not
in the order the data was added to the array.

The data seems to be stored in correct order but "foreach $var (keys
%fields)" outputs in wrong order?

I am sure I am doing something simple wrong here.

Any ideas?

Thanks for the input.

Working code is at http://www.arcom.com.au/~khan/domains.html



My code is here (only relevant code listed, full listing at www site)

$temp=$ENV{'QUERY_STRING'};

print $temp;        # this prints fields in order submited by form

@pairs=split(/&/,$temp);

foreach $item(@pairs) {
   ($key,$content)=split (/=/,$item,2);
   $content=~tr/+/ /;
   $content=~ s/%(..)/pack("c",hex($1))/ge;
   $fields{$key}=$content;
   print "$key, $content";  # Still printed in order of form one at a
time for each loop
   }

sub WriteFile{
open (data, ">> $Filename") || Bust("Failed to open File
\"$Filename\".");

# This prints OK but in wrong order?
print "Values  produced by \"print (values %fields)\"";print (values
%fields);

foreach $var (keys %fields){
    # This prints OK but in wrong order
    print "$var:\t";
    print "$fields{$var}";
    # this prints to file but in wrong order.
    print data "$fields{$var}:";
    }
    print data "\n";
    close (data);









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

Date: Wed, 23 Jun 1999 09:26:50 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Perl and Personal Web Server (Win98)
Message-Id: <37709A4A.E79125AD@dave.org.uk>

chitown34@my-deja.com wrote:
> 
> I'm trying to configure ActivePerl for use with
> Microsoft's Personal Web Server on a Windows98.
> 
> I installed PWS and ActivePerl.
> 
> There is a mention of changing some registry
> settings in the documentation, but I am hesitant
> because I am unfamiliar with registy info and I
> don't want to screw anything up.
> 
> Could someone provide me step by step instructions
> for modifying the registry as required by the
> documentation?

Presumably the people a Windows web server newsgroup will be able to
help you.

Here, we discuss Perl.

Good luck,

Dave...


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

Date: 23 Jun 1999 03:08:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <slrn7n15ga.k1b.abigail@alexandra.delanet.com>

Bart Lateur (bart.lateur@skynet.be) wrote on MMCXXII September MCMXCIII
in <URL:news:377383f4.2250661@news.skynet.be>:
() Abigail wrote:
() 
() >I don't think FAQs are
() >original content, but Gregs little program thinks they are. Why doesn't
() >anyone get upset about that,
() 
() I mentioned that. I called it "posts like TomC's, with lots of extracts
() from, for example, PERLFUNC".


Oh, I wasn't thinking about TomC. I was thinking about the people TomC
replies to.



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: Wed, 23 Jun 1999 09:18:43 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Summing an array
Message-Id: <37709863.B535AF98@dave.org.uk>



James Stewart wrote:
> 
> Just wondering how to find the sum of all the elements of an array. A
> look through the FAQs doesn't yield an answer. I guess I could do it with
> a loop, but I'm guessing there's a more elegant solution.

my $sum = eval (join q/+/,@arr);

Dave...


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

Date: 23 Jun 1999 02:02:24 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Summing an array
Message-Id: <yl1zf35ly7.fsf@windlord.stanford.edu>

In comp.lang.perl.misc, Mark-Jason Dominus <mjd@op.net> writes:

> It seems to me that in the last ten years or so there's been a change in
> the way programmers talk about data structures.

> When I learned to program, data structure names like `array' referred to
> implementations or particular algorithms.  But it seems that more and
> more often, people use names like `array' to refer to interfaces rather
> than implementations, and will call anything an array as long as it
> supports an indexed access.

Ah... yes.  I see where you're coming from, and plead guilty to doing
precisely that.  To sum an array, you need a loop, because an array by
strict definition can't contain the shortcut information you'd need to do
something else (or it wouldn't be an array).

Also, properly speaking, the data structure I wrote wasn't a skip list; it
was an annotated skip list that included sum information as well as the
standard skip list data structures.

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


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

Date: 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 6105
**************************************

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