[13050] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 460 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 11 12:07:17 1999

Date: Wed, 11 Aug 1999 09:05:24 -0700 (PDT)
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, 11 Aug 1999     Volume: 9 Number: 460

Today's topics:
        About qq() and need help <yoursguideline@hotmail.com>
    Re: Are PerlApp and Perl2exe the same? dakbat@hotmail.com
    Re: Browser detection - write different html (Abigail)
    Re: Browser detection - write different html (Greg Bacon)
        CGI Error - CGI application misbehaved goparajs@usa.redcross.org
    Re: CGI Error - CGI application misbehaved <james.williamson@bbc.co.uk>
    Re: Date <USENET@questionexchange.com>
    Re: Date::Manip SLOW (Sean McAfee)
    Re: finding array size <aqumsieh@matrox.com>
    Re: Getting perl to accept a flat table file <martin@adoma.se>
    Re: Getting perl to accept a flat table file <aqumsieh@matrox.com>
    Re: hash in record (Gary O'Keefe)
    Re: Help - Split Function Blowing My Mind Away!! (Mike Kozlowski)
        Help Perl (Anno Siegel)
    Re: http://www.perl.com gone? (Abigail)
    Re: http://www.perl.com gone? <elaine@chaos.wustl.edu>
    Re: Improving speed of a sub <dhill@sunbeach.net>
    Re: Improving speed of a sub (Anno Siegel)
    Re: Improving speed of a sub <aqumsieh@matrox.com>
    Re: is our reese the author of mysql book? (Larry Rosler)
    Re: is our reese the author of mysql book? <uri@sysarch.com>
    Re: Looking for a good Perl Book (Abigail)
    Re: Looking for a good Perl Book <elaine@chaos.wustl.edu>
    Re: LWP for a secure server <elaine@chaos.wustl.edu>
    Re: Mac perl2exe? (Chris Nandor)
        Msql-Mysql-modules-1.2202 <gavin@enter.net>
        not a curses window? rangerny@my-deja.com
        obtaining local IP address in ActivePerl <Jonathan_Epstein@nih.gov>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 11 Aug 1999 22:14:54 +0800
From: Guideline Chan <yoursguideline@hotmail.com>
Subject: About qq() and need help
Message-Id: <37B1855E.63A57C5D@hotmail.com>

$alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
            'abcdefghijklmnopqrstuvwxyz'.
            '0123456789+/';
$_="vq7O";
eval qq{ tr!$basealphabet!\0-\77!; };

What's the meaning of the fifth line??? Is it equivalent to
tr/$basealphabet/\0-\77/; ?? if not, what does it equivalent to???

--
thanks



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

Date: Wed, 11 Aug 1999 15:54:45 GMT
From: dakbat@hotmail.com
Subject: Re: Are PerlApp and Perl2exe the same?
Message-Id: <7os6bv$d6p$1@nnrp1.deja.com>

  Just to let people know what I have found out. I called Mercury
Software who produces Perl2Exe and I was very impressed with their
technical support. They answered all my questtions and appeared very
knowledgable. They have email and telephone support options and this is
included with the purchase of the Perl2Exe Pro version ($150). If
anybody else has further comments on the two products please post them
also. Thanks..

-David

In article <7opo1a$lck$1@nnrp1.deja.com>,
  dakbat@hotmail.com wrote:
>  The subject says it all. I have seen PerlApp on ActiveState's site
and
> perl2exe on a seperate website (www.perl2exe.com). Are they the same?
> If not does anyone know the advantages/disadvantages of each? Thanks
>
> --
>
> David
> dakbat@hotmail.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

--

David
dakbat@hotmail.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 11 Aug 1999 10:21:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Browser detection - write different html
Message-Id: <slrn7r3570.d2r.abigail@alexandra.delanet.com>

Mark (Mark@Mark.Com) wrote on MMCLXXI September MCMXCIII in
<URL:news:37B1327A.5A03E25C@Mark.Com>:
'' 
'' Robert wrote:
'' 
'' > What we are looking for is a perl/cgi script or a java script that will
'' > accomplish the following...When a user comes to our page, the script will
'' > detect the browser app ver # and take an action base on that result. What w
'' > want is when a browser is 4.0 or better, we want the page to load a
'' > shockwave slideshow, if the browser is lower and can't handle shockwave we
'' > want the page to load a java applet slide show. Now, were not sure if this
'' > can be done so we'll end by saying this. Our company is will to pay top
'' > dollar for a working script that will do this. Please reply or send to
'' > enquiries to ducott@intergate.bc.ca
'' 
'' I know how to do this! Can I have top dollar please?
'' 
'' Anyway, here it is:
'' 
'' In any CGI script, the env variable HTTP_USER_AGENT contains the name of the
'' requesting client. You can figure out from this ($ENV{'HTTP_USER_AGENT'}) wha

Remind me never to hire you. You don't know HTML - you just give a
customer what they ask for, not what they want. You're just someone who
cranks out code, but there's no expertise.



Abigail
-- 
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$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: 11 Aug 1999 16:02:28 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Browser detection - write different html
Message-Id: <7os6qk$jv7$2@info2.uah.edu>

In article <37b02e4e@carrera.intergate.ca>,
	"Robert" <ducott@intergate.bc.ca> writes:
: What we are looking for is a perl/cgi script or a java script that will
: accomplish the following...When a user comes to our page, the script will
: detect the browser app ver # and take an action base on that result.

    Anyone who slaps a "this page is best viewed with Browser X" label
    on a Web page appears to be yearning for the bad old days, before
    the Web, when you had very little chance of reading a document
    written on another computer, another word processor, or another
    network.
        -- Tim Berners-Lee in Technology Review, July 1996

Greg
-- 
A wise man speaks because he has something to say, a fool because he has to
say something. 
    -- Plato


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

Date: Wed, 11 Aug 1999 14:34:50 GMT
From: goparajs@usa.redcross.org
Subject: CGI Error - CGI application misbehaved
Message-Id: <7os1m9$9f9$1@nnrp1.deja.com>

Can Any one can explain this error

" The Specified CGI application misbehaved by not returning a complete
set of HTTP Headers. The  headers it returned are : "

Here is the script

#!/usr/bin/perl -w

use CGI qw(:all);

 	my $page = new CGI;
	print $page->header;
	print $page->start_html;
	print "Test Script:<BR>";
	print $page->end_html;

When i execute from command line its is executing fine, but from IE4
browser, I am getiing the above error. I am using Active Perl 5.005_02
for winnt

Thanks in advance
sreedhar




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 11 Aug 1999 15:57:34 +0100
From: "James Williamson" <james.williamson@bbc.co.uk>
Subject: Re: CGI Error - CGI application misbehaved
Message-Id: <7os33k$ghh$1@nntp0.reith.bbc.co.uk>

Yep,
If you run it through DOS you'll see it doesn't print that all important
content-type: text/hml
which without the browser will throw a wobbly.
Strange, even though the CGI import set ':all' stipulates it will import all
available methods, it doesn't appear to have imported the header method. Try

use CGI;

And you'll find this script works.

James


goparajs@usa.redcross.org wrote in message <7os1m9$9f9$1@nnrp1.deja.com>...
>Can Any one can explain this error
>
>" The Specified CGI application misbehaved by not returning a complete
>set of HTTP Headers. The  headers it returned are : "
>
>Here is the script
>
>#!/usr/bin/perl -w
>
>use CGI qw(:all);
>
> my $page = new CGI;
> print $page->header;
> print $page->start_html;
> print "Test Script:<BR>";
> print $page->end_html;
>
>When i execute from command line its is executing fine, but from IE4
>browser, I am getiing the above error. I am using Active Perl 5.005_02
>for winnt
>
>Thanks in advance
>sreedhar
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.




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

Date: 11 Aug 1999 15:25:48 GMT
From: QuestionExchange <USENET@questionexchange.com>
Subject: Re: Date
Message-Id: <749qx@questionexchange.com>

> I'm using the Date::manip module to print a range of dates
> (e.g. Jan-  99, Feb-99, Mar-99, etc).  I'm finding, though,
> that this modules really slowed down my CGI program.  Before I
> started using the module, my output would come up in browser
> pretty fast.  So, does anyone know how to speed up the
> date::manip module?   -- Paul R. Mesker System Engineer Dirigo
> Inc.   Sent via Deja.com http://www.deja.com/ Share what you
> know. Learn what you don't.

It might be that you're asking the wrong question. When you do
"use Date::Manip", the interpreter has to read and parse the
module for every time the script is run, if you are using plain
vanilla CGI scripts.   The answer is to use Apache's mod_perl
or FastCGI, in both of which the interpreter and its loaded
modules can stay in memory.

-- 
  This answer is courtesy of QuestionExchange.com
  http://www.questionexchange.com/servlet1/showUsenetGuest?ans_id=2506&cus_id=USENET&qtn_id=1664


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

Date: Wed, 11 Aug 1999 15:06:21 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Date::Manip SLOW
Message-Id: <Njgs3.1267$J72.192122@news.itd.umich.edu>

In article <slrn7r250q.cat.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Sean McAfee (mcafee@waits.facilities.med.umich.edu) wrote on MMCLXX
>September MCMXCIII in <URL:news:MHXr3.1075$J72.156986@news.itd.umich.edu>:
>"" >So, does anyone know how to speed up the date::manip module?

>"" Have you tried A) using Devel::DProf to profile your code and locate the
>"" bottlenecks, or B) contacting the module's author with your concerns?

>Considering that the author addresses these concerns in the documentation,
>including suggestions what the do about it, I'd think B) is not something
>you should do.

I made the assumption that the documentation had been perused first.  Bad
assumption, I know...

Here's the missing step:

@) RTFM!

-- 
Sean McAfee                                                mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!


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

Date: Wed, 11 Aug 1999 09:46:51 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: finding array size
Message-Id: <x3y3dxqbfat.fsf@tigre.matrox.com>


Margaret Escherich <glasscat@shell7.ba.best.com> writes:

> I need to send chunks of data to a memory challenged device and I'm
> exploring different techniques for 
> doing so.

You could try to send the array one element at a time. If a single
element is too big, then chop it up. 

Perhaps you might even create an array of arrays, such that the
elements of each inner (anonymous) array make up one element of the
outer array. For example:

@array = ('this is one very very very very long sentence',
	  'and another one',
	 );

You could change this to:

@array = (
	  ['this is one',
	   'very very very',
	   'very long sentence'],

	  ['and another one']
	 );

Or you might even convert your whole array into a string, send it by
chunks, then resplit it into an array. But you'll have to choose a
delimiter that is guaranteed not to appear in your array:

	my $str = join 'SOME_DELIMETER' => @array;
	# chop up $str if needed, probably using
	# substr() or a regexp.
	# send the chopped up strings

	# Now you should join the strings back
	# into one and split() again

	my @array = split 'SOME_DELIMITER' => $str;

HTH,
Ala



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

Date: Wed, 11 Aug 1999 16:35:38 +0100
From: "Martin Quensel" <martin@adoma.se>
Subject: Re: Getting perl to accept a flat table file
Message-Id: <7os31j$599$1@cubacola.tninet.se>


Paul Foran skrev i meddelandet <37B1703D.3483F276@analog.com>...
>Andreas Fehr wrote:
>
>> On Wed, 11 Aug 1999 09:21:20 +0100, Paul Foran <Paul.Foran@analog.com>
>> wrote:
>>
>> >Can somebody tell me how to get perl to accept a comma delimited txt
>> >file and parse it contents.
>>
>> Yes, write some Perl code and run it with the filename as parameter.
>>
>> Andreas
>
>How can I do this exactly???


Buy a book and learn perl.

You could also try some reading some articles on the net.
www.perl.com is always a good place to start, and Brent Michalski has some
intresting collumns at www.webreview.com that deal with what your after.

Or do you want someone to write it for you?

/Martin Quensel





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

Date: Wed, 11 Aug 1999 10:18:16 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Getting perl to accept a flat table file
Message-Id: <x3yzozy9z9z.fsf@tigre.matrox.com>


Paul Foran <Paul.Foran@analog.com> writes:

> Can somebody tell me how to get perl to accept a comma delimited txt
> file and parse it contents.

Maybe if you ask it nicely. You might even need to get on your
knees. But no matter what happens, don't blink.



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

Date: Wed, 11 Aug 1999 15:19:06 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: hash in record
Message-Id: <37b1930f.91226002@news.hydro.co.uk>

A keyboard was smashed into Peter Huesser's face and out came:

[ nasty mime stuff snipped ]

>#!/usr/bin/perl
>
>%some_table = (
>    'gaga' => 1,
>    'baba'=> 2,
>    );
>
>print $some_table{'gaga'},"\n";
>
>$rec = (
>  total => 10,
>  LOOKUP =>  { %some_table } ,
>);

This is a hash, not a scalar, assignment. You got it right for
%some_table.

%rec = (
	total  => 10,
	LOOKUP => { %some_table };
);

>print $rec->{LOOKUP}{'gaga'},"\n";

print $rec{LOOKUP}{gaga}, "\n";

The inverted commas around 'gaga' and 'baba' are not necessary.

HTH

Gary
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: 11 Aug 1999 15:41:48 GMT
From: mkozlows@guy.ssc.wisc.edu (Mike Kozlowski)
Subject: Re: Help - Split Function Blowing My Mind Away!!
Message-Id: <7os5js$is0$1@news.doit.wisc.edu>

In article <MPG.121a4f373dba2a21989e26@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>
>Use of incorrect context:  my $x = @_; my ($y) = @_;

Are you saying that both of those are wrong, or that the first is wrong
and the second correct?

(Because I use that second form, or variants of it, all the time with no
problem...)

-- 
Michael Kozlowski                                        
http://www.cs.wisc.edu/~mlk/


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

Date: 11 Aug 1999 14:20:21 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Help Perl
Message-Id: <7os0r5$ovk$1@lublin.zrz.tu-berlin.de>

 <mhc1587@pevt100.ca.boeing.com> wrote in comp.lang.perl.misc:
>
>Hi,
>
>I need to write a perl program to print name of person, who had
>any process run in background.
>
>In my foreach loop below, will repeat print if user had more than one
>process.
>All I want is only one user name. Can you help ?
>
>I used foreach loop, because part of big program.
>
>
>foreach $process (`ps -ef | grep root`) {

Why the grep for root here?  It's rather unspecific, but will throw
out most processes that are not run by root.  Perhaps you meant to
say "grep -v root" because root usually has many processes running?

>($login_ID) = (split / +/,$process)[1];
>print "$login_ID\n";
>}

The two replies to your question that I see address only half of
your problem, not showing how to select those users who have more
than one process.  They are right in that they recommend a hash
to count the processes, though I'd build it up slightly differently:

#!/usr/bin/perl -w
use strict;

my $pscmd = 'ps aux'; # your os may vary
my %pcount;

$pcount{ (split / +/, $_)[ 0]}++ foreach `$pscmd`;

$pcount{ USER}--; # first line of ps output starts with 'USER'
delete $pcount{ root}; # if you don't want root

print "Users with more than one process:\n";
print "$_\n" foreach grep $pcount{ $_} > 1, keys %pcount;

__END__

Of course, that's only as portable as ps is, that is not at all.

Anno



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

Date: 11 Aug 1999 10:05:30 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: http://www.perl.com gone?
Message-Id: <slrn7r349a.d2r.abigail@alexandra.delanet.com>

Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote on MMCLXXI September
MCMXCIII in <URL:news:37B0D906.86796278@chaos.wustl.edu>:
?? Martien Verbruggen wrote:
?? > The links are there in lynx as well. Maybe you should try again.
?? 
?? C'mon darling, many of the links were broken when Tom recently redid the
?? design of perl.com. Perhaps the user isn't terribly industrious, but the
?? site did change quite a bit.


Tom redid the design? I've an email from someone else claiming he did it....
I would find it very hard to believe Tom would design something, and come
with how www.perl.com looks like.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== 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, 11 Aug 1999 11:13:55 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: http://www.perl.com gone?
Message-Id: <37B192CF.9ED8AA3A@chaos.wustl.edu>

Abigail wrote:
> Tom redid the design? I've an email from someone else claiming he did it....
> I would find it very hard to believe Tom would design something, and come
> with how www.perl.com looks like.

Well, ok, _someone_ redesigned the site :) I have a few links on the
history to fix because of it.

e.


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

Date: Wed, 11 Aug 1999 10:36:37 -0400
From: Duncan Hill <dhill@sunbeach.net>
Subject: Re: Improving speed of a sub
Message-Id: <Pine.LNX.4.10.9908111035060.22584-100000@bajan.pct.edu>

On Wed, 11 Aug 1999, brian d foy wrote:

> In article <Pine.LNX.4.10.9908102231260.19529-100000@bajan.pct.edu>, 
> Duncan Hill <dhill@sunbeach.net> posted:
> 
> > On Tue, 10 Aug 1999, brian d foy wrote:
> > >    my $data = <FILE>;

> > Urm.. ok, I may be a twit here, but wouldn't that try and read the
> > entire file into a scalar?  Granted, memory isn't too much of an issue

> do you want speed or memory?  choose one (1).

Urk.. oh well, speed I guess.. the server can take the shock.

-- 

Duncan Hill			Sapere aude
One net to rule them all, One net to find them,
One net to bring them all, and using Unix bind them.




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

Date: 11 Aug 1999 15:12:36 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Improving speed of a sub
Message-Id: <7os3t4$p28$1@lublin.zrz.tu-berlin.de>

Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>[Posted and a courtesy copy sent.]
>
>In article <VH7s3.315$gp7.189956096@news.frii.net> on Wed, 11 Aug 1999 
>05:17:41 GMT, Jack Applin <neutron@bamboo.verinet.com> says...
>> Duncan Hill <dhill@sunbeach.net> wrote:
>> 
>> >         while (<COPYRIGHT>)
>> >         {
>> >                 s/referrer/$foo/;
>> >                 print;
>> >         }
>> 
>> The /o flag would make it faster, since $foo doesn't change in the loop:
>> 
>>                  s/referrer/$foo/o;
>
>Sorry, Jack, that's irrelevant.  The /o flag affects whether the regex 
>part of the operation should be recompiled or not for each repetition of 
>the loop; because there are no interpolations into the regex, it never 
>needs recompilation.

What could help, though, is using the fact that we have a fixed
substring to match.  So, in the loop, do:

  substr( $_, $i, 8) = $foo if ($i = index $_, 'referrer') > -1;

Anno


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

Date: Wed, 11 Aug 1999 09:58:33 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Improving speed of a sub
Message-Id: <x3y1zdabera.fsf@tigre.matrox.com>


Jack Applin <neutron@bamboo.verinet.com> writes:

> Duncan Hill <dhill@sunbeach.net> wrote:
> 
> >         while (<COPYRIGHT>)
> >         {
> >                 s/referrer/$foo/;
> >                 print;
> >         }
> 
> The /o flag would make it faster, since $foo doesn't change in the loop:
> 
>                  s/referrer/$foo/o;

This is a useless piece of advice since the /o modifier is "irrelevant
unless variable interpolation is used in the pattern."

In this case the pattern 'referrer' is a literal string, with no
variable interpolation. So the /o modifier is useless.

The above quote is from perlfaq6:

     What is /o really for?

You have read perlfaq6 .. haven't you?

Ala



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

Date: Wed, 11 Aug 1999 08:18:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: is our reese the author of mysql book?
Message-Id: <MPG.121b343b39f370f4989e31@nntp.hpl.hp.com>

In article <slrn7r2bi2.cat.abigail@alexandra.delanet.com> on 11 Aug 1999 
03:03:31 -0500, Abigail <abigail@delanet.com> says...
> Uri Guttman (uri@sysarch.com) wrote on MMCLXXI September MCMXCIII in
> <URL:news:x7g11qanob.fsf@home.sysarch.com>:
> ,, i noticed the name george reese as one of the authors of the new
> ,, o'reilly book mysql & msql. is that the same twit who kept a stupid
> ,, flame war going for weeks last year? i don't feel like i can stomach
> ,, reading those old posts again. the book page claims he wrote a jdbc and
> ,, java book which i seem to recall from the war and that explains his
> ,, total lunkheadedness about perl.
> 
> Seems like the same guy.
 ...
> I'd rather have a Matt Wright every day, then a George Reese once in
> a lifetime.

I already expressed my qualms about this book based on the sample 
chapter, which seemed to focus too much on the CGI/HTML interface and 
too little on the SQL aspects.

I'll probably let my order stand anyhow.  But I hope I'm not wasting my 
company's money on it.

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


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

Date: 11 Aug 1999 11:55:03 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: is our reese the author of mysql book?
Message-Id: <x7d7wu9uso.fsf@home.sysarch.com>



posted to c.l.p.misc and emailed to o'reilly.

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

  A> I'd rather have a Matt Wright every day, then a George Reese once in
  A> a lifetime.

it's funny how well known matt is but you never see him post (at least
not here where he is most revered). i remember how you said similar
things back when reese was contaminating this group. the new book has 2
other authors so he might be diluted to only class C pollution. sorta
partly like treated sewage.

the chapter on the o'reilly site is on perl and has these gems:

$server = param('server') or $server = '';

we are partial to the object-oriented syntax, if only because the arrow
makes the relationship between class and method clear.

<that is fine but then i found this code>

my $output = new CGI;


here is an ugly one:

if (not @databases) {

they never heard of, or like unless. this is a common idiom they use.


the indenting online looks very odd. some code is on the left margin and
some is not. could just be html crap. i haven't seen the book.

here is some real buggy stuff

my $table_data = $dbh->prepare("select * from $table");
# Now send the query to the server.
$table_data->execute;
 
# If the return value is undefined, the table must not exist. (Or it could
# be empty; we don't check for that.)
if (not $table_data) {
        print header, start_html('title'=>

they are checking the wrong thing. how could $table_data get changed by
the method call to execute? and if it was false, the call to execute
would blow up.

# using the MySQL driver and accessing the 'teach' database.
my $dbh = DBI->connect('DBI:mysql:teach');
The add action itself is broken up into three separate functions. The first 
function, add, prints out the template form for the user to create a new 
test.
sub add {


someone forgot the # for comments in the above section.

   my @ids = ();
   my %subjects = ();
  

useless init with ().
for scalars, initing to '' or 0 makes some sense with -w but not with
aggregates.


   my $subject = param('subjects');
   my $num = param('num');
   $name = param('name') if param('name');
 
   my $out = $dbh->prepare("select name from subject where id=$subject");
   $out->execute;
   my ($subname) = $out->fetchrow_array;
 

$name is not declared. and they are inconsistant with () around the my
args.



in general it looks like this chapter was not tech reviewed by anyone
who knows perl very well. i blame o'reilly as much as the trio of
authors. 

on the good side all the examples use -w and strict but i doubt they all
run as i have shown several real bugs in both syntax and code. and i
have only gone thru half the chapter and not with a finetoothed comb.

anyone from o'reilly lurking here? i will cc this to them.


uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 11 Aug 1999 10:15:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Looking for a good Perl Book
Message-Id: <slrn7r34r9.d2r.abigail@alexandra.delanet.com>

Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCLXX September MCMXCIII in
<URL:news:x3ywvv37oaq.fsf@tigre.matrox.com>:
[] 
[] [posted and CCed]
[] 
[] Michael Prendergast <mprender@virtualis.com> writes:
[] 
[] > I'm looking for a good Perl book to learn from. I do have programming
[] > experience and I was wondering if any of you have a suggestion as to
[] > which is a good book to introduce me to the Perl language. I'm not
[] > *just* looking for an intro book though, I mean one with depth also, and
[] > some assignments/quizzes also.
[] 
[] Ok. The best book for beginners would be "Learning Perl" (aka the
[] Llama) written by R. Schwartz and T. Christiansen, published by
[] O'Reilly.

That's a matter of opinion I do not share. The usefullness of postings
like this of increase if you indicate why you think it is the best book.
Presenting opinions as facts isn't very useful.

[] The best reference on Perl would be "Programming Perl" (aka the Camel)
[] written by L. Wall, T. Christiansen and R. Shwartz, published by
[] O'Reilly.

Weird. The most recent version of that book has "5.003" on the cover.
The current version of Perl is 5.005, and was released a year ago.
Perl 5.6 might be out before the end of the year. A lot of things have
changed. While PP contains a lot of information, I hestitate to say it's
the best reference.

[] If you want to get the most out of Perl, then I suggest 3 more books:
[] 
[] 1) The Perl Cookbook (aka the Ram) by T. Christiansen and
[]    N. Torkington, published by O'Reilly.
[] 
[] 2) Advanced Perl Programming (aka the Panther) by S. Srinivasan,
[]    published by O'Reilly.
[] 
[] 3) Mastering Regular Expressions (aka the Owl) by J. Friedl, published
[]    by O'Reilly.
[] 
[] (do you see a pattern here?)

Yeah. You got paid by O'Reilly?  ;-)

[] Another useful book that I learnt a great deal from (too bad it has
[] many typos) is the Perl5 Interactive Course, by J. Orwant, published
[] by Waite Group. It contains some nice quizzes that aided my
[] understanding greatly.

Here you finally give a reason why you like a book, and now you don't
rank it!

[] > Plus, does anyone know of a good online school to learn Perl/Unix?
[] > Preferably one with begginer and advanced Perl courses.
[] 
[] My only advice here is to read the online docs that come with every
[] Perl distribution. Perl's docs are complete, up-to-date, free, and your
[] best source of quick solutions for over 90% of your problems with
[] Perl.
[] 
[] Just type 'perldoc perldoc' at the command prompt (assuming Perl is
[] properly installed), and enjoy :)
[] 
[] As for learning Unix, then I say:
[] 1) get Linux
[] 2) install it

That's like saying "for learning how to drive a car, get the parts and
assemble it".

[] 3) get any unix book from O'Reilly

I'd trade all Unix books from O'Reilly for any book written by Kernighan
or Pike.

[] 4) Enjoy Your Freedom (tm).

Freedom? You only let me choose from O'Reilly! That's not freedom....




Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== 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, 11 Aug 1999 11:29:22 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Looking for a good Perl Book
Message-Id: <37B1966D.772CD4BB@chaos.wustl.edu>

Abigail wrote:
> [] 3) get any unix book from O'Reilly
> 
> I'd trade all Unix books from O'Reilly for any book written by Kernighan
> or Pike.

abigail++ :) Marry me darling. 

e.


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

Date: Wed, 11 Aug 1999 11:02:47 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: LWP for a secure server
Message-Id: <37B19032.B9350673@chaos.wustl.edu>

David Oukrat wrote:
> i want use a similar function for a 'https' server
> LWP gives "server down" with a 'https' server
> this is my function for a 'http' server

http and https use two different protocols on two different ports. 

Go get Net::SSLeay from CPAN and view the readme.

e.


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

Date: Wed, 11 Aug 1999 14:52:32 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Mac perl2exe?
Message-Id: <pudge-1108991052350001@192.168.0.7>

In article <37B16DD7.97529BA7@dachau.baynet.de>, e.seifert@gmx.net wrote:

>I wonder if there's something like perl2exe for Apple Macintosh?

You mean Mac OS?

Save a script in MacPerl.  Select runtime.

In order to use modules, you need to supply those separately.  Look online
for RuntimeBuilder to help out with it.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Wed, 11 Aug 1999 10:22:26 -0400
From: Gavin G <gavin@enter.net>
Subject: Msql-Mysql-modules-1.2202
Message-Id: <934382522.429263977@news.enter.net>

I recently compiled perl 5.005_03 on BSDI 4.01 and then installed MySql.  I had
all this running on a linux machine with no problems.  Then when I need to put
it on to the companies servers I am getting strange errors.  I have seen others
post this problem too, but no resolution.  I installed DBI and tried to install
Mysql perl module.  This is the problem

Can't load '/usr/local/lib/perl5/site_perl/5.005/i386-bsdos/auto/DBD/mysql/mysql.so'
 for module DBD::mysql: File not found at
usr/local/lib/perl5/5.00503/i386-bsdos/DynaLoader.pm line 169.

Now the file is actually there, but its like it cant find it or cant't link it
properly.  This is the first time I have had any problems with perl modules. 
Any help would be greatly appreciated.

PS: Please reply through e-mail

Gavin G
gavin@enter.net



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

Date: Wed, 11 Aug 1999 14:14:18 GMT
From: rangerny@my-deja.com
Subject: not a curses window?
Message-Id: <7os0ff$8hj$1@nnrp1.deja.com>

Hey folks,

After 18 months of flawless operation, one of our Perl apps is now
returning the following error from a subroutine:

-----------------
argument 0 to Curses function 'move' is not a Curses window at (eval 67)
line 1.
------------------

Anyone ever see this one before?  We're stumped!

-


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 11 Aug 1999 12:04:11 -0500
From: Jonathan Epstein <Jonathan_Epstein@nih.gov>
Subject: obtaining local IP address in ActivePerl
Message-Id: <37B1AD0B.4C65BD49@nih.gov>

Given the lack of getnetbyname() on ActivePerl (Win32) and the apparent
lack of hostname() when running it under Win95, what tricks do people
use to obtain their local IP address?

Perhaps there's some trick of connecting to a well-known web server, and
reading back your own IP address from that server?

I'm familiar with the pseudo-IP address 127.0.0.1 which always refers to
the local host, but that isn't going to cut it in this case ... I need
the real IP address.

TIA,

- Jonathan



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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 460
*************************************


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