[6672] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 297 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 14 12:20:49 1997

Date: Mon, 14 Apr 97 09:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 14 Apr 1997     Volume: 8 Number: 297

Today's topics:
     Beginner - Time constaints (Mark Turner)
     Compliling Perl Win32 into an .EXE file <jont@uunet.pipex.com>
     Re: Crypt function doesn't appear to work (David Alan Black)
     Employment Opportunity (Michael D. Deerfield)
     Grabbing links from html pages? David_D._Jones@hud.gov
     Re: Index of items in a list? (Andrew M. Langmead)
     Re: Ousterhout and Tcl lost the plot with latest paper (Bruce S. Tobin)
     Re: perl pattern matching (Honza Pazdziora)
     Perl to Oracle on a NT-Server <jm@qsd.no>
     Re: Perl-Books. <merlyn@stonehenge.com>
     Problem with code fragment <manemann@dubuque.net>
     Problems Building Perl WIN32 on NT <jerry@gbs.ch>
     QUESTION: hidden traps if blessing into container class (Terrence M. Brannon)
     Re: QUESTION: hidden traps if blessing into container c (Terrence M. Brannon)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Cyber Surfer)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Gary D. Duzan)
     Returning an array with hashes <vegardb@knoll.hibu.no>
     Re: Returning an array with hashes (David Alan Black)
     Running as root <wschow@Comp.HKBU.Edu.HK>
     sockets.pl library module for CGI <Mark.Grimshaw@ucsalf.ac.uk>
     Re: Ugly Versus Elegant (Was: Reply to Ousterhout's rep <thant@acm.org>
     Re: Unix and ease of use  (WAS: Who makes more ...) <fellowsd.cs@man.ac.uk>
     user authentification <santiago@gambito.com>
     Re: Working perl script... not running with HTTP get. (nick^)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 14 Apr 1997 11:37:28 GMT
From: turnerm@cs.man.ac.uk (Mark Turner)
Subject: Beginner - Time constaints
Message-Id: <5it4to$oqd@m1.cs.man.ac.uk>


Hi,

I am a new comer to Perl and I need a little advice.

I am writing a Perl program which halfway through executes a C program,
I would like to put some kind of time constraint on this C program so the
it carn't get stuck in a continous loop.

What I need to say in Perl it execute this C program and if it hasn't
completed within 3 seconds stop it running.

Can anybody help, or at least tell me at what commands I sould be looking.

Cheers,


Mark.


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

Date: Mon, 14 Apr 1997 15:19:18 +0100
From: "Jonathan Tracey" <jont@uunet.pipex.com>
Subject: Compliling Perl Win32 into an .EXE file
Message-Id: <5iteb9$j2k@wave.news.pipex.net>

How can I compile a Perl Win32 script into a .EXE file?

Cheers
Jon............





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

Date: 14 Apr 1997 13:54:50 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Crypt function doesn't appear to work
Message-Id: <5itcva$jui@pirate.shu.edu>

tadmc@flash.net (Tad McClellan) writes:

>Randal Schwartz (merlyn@stonehenge.com) wrote:
>: >>>>> "David" == David Alan Black <dblack@icarus.shu.edu> writes:

>: David> friedman@medusa.acs.uci.edu (Eric D. Friedman) writes:
>: >> use subs qw(randalphanum);

>: David> This one 'l' spelling is really catching on :-)

>: Would that make me the [Randal] Phanum of the Opera-tor?


>Your fame as a punster is well known.

>This one is like bleu cheese left out of the refrigerator though...  ;-)

Oh, no, I find it all very informative.  We knew Randal was
a phenom.  Now we know he's a phanum.  Amazing what a phanum
phenom can do with a phoneme.

David Black
dblack@icarus.shu.edu



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

Date: Sat, 12 Apr 1997 22:15:03 GMT
From: miked@deerfield.net (Michael D. Deerfield)
Subject: Employment Opportunity
Message-Id: <5ip23p$hmv@vixc.voyager.net>

Hi;

Deerfield Companies (http://www.deerfield.com/) is actively seeking
individuals to add to our Internet Communications and Commerce
Division. Responsibilities include managing company Internet commerce
servers. Deerfield Companies is located in the Northern Michigan
community of Gaylord (http://www.otsego.com/). 

Experience Required : HTML, CGI, PERL
                  Unix/NT server administraion 

For more information on this position or to refer a colleague, please
contact:

Deerfield Companies
Employment@deerfield.net
517.732.8856




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

Date: Mon, 14 Apr 1997 08:03:38 -0600
From: David_D._Jones@hud.gov
Subject: Grabbing links from html pages?
Message-Id: <860781108.10211@dejanews.com>

I want to be get every link from an HTML document.  Actually what I really
want is everything between the <A HREF> and </A> tags.  I can get this to
work if there is only one link per line,  but I'm not sure how to do this
if there is more than one link per line or it the link spans more then
one line.   Any suggestions?


Thanks,
-David

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 14 Apr 1997 14:24:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Index of items in a list?
Message-Id: <E8MtD8.J5C@world.std.com>

friendly@hotspur.psych.yorku.ca (Michael Friendly) writes:

>I have an application where I have a list of names (@names), and
>another list (@permuted) which contains (??) the same names in
>a possibly different order.  Eg.,

>@names =  ('henry', 'lucy', 'snoopy' 'linus');
>@permuted = ('snoopy', 'henry', 'lucy', 'mary');

>I need to find the position index of each element of @names in 
>@permuted, i.e., the result should be the list 
>@indices = ( 3, 1, 2).


How about if you have the names in a hash with the key being the index
number.

@names{@names} = ( 0 .. $#names );
@indicies = @names{@permuted};

(or maybe: 
@names_hash{@names} = ( 0 .. $#names );
@indicies = @names_hash{@permuted};

If you dislike hashes and arrays with identical names. I have to admit
it looks especially confusing with hash slices.)
-- 
Andrew Langmead


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

Date: 14 Apr 1997 14:02:30 GMT
From: btobin@infinet.com (Bruce S. Tobin)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5itddm$5b9@news1.infinet.com>

John Ousterhout (ouster@tcl.eng.sun.com) wrote:

: I overstated the arguments against OO programming in the paper and I'll
: probably soften them a bit in the next draft.  I actually think that
: there are some good aspects of OO programming, and I use them myself
: even when I'm not programming in an OO language.  But I stand by the two
: main points in the paper, which are that (a) OO programming hasn't
: increased productivity dramatically because it doesn't raise the level of
: programming significantly (it may improve things 20-30%, but I doubt
: there's even a factor of 2, let alone 10) and (b) implementation
: inheritance really truly is a bad idea that tends to reduce reuse and
: productivity.

  OO alone won't increase productivity significantly, but if you take
a well-designed OO language (i.e., pretty much anything except C++),
and add a good class library and application framework aimed at a
particular problem domain, your productivity gains can be very 
impressive; often greater than what you get with a scripting language 
tailored to the same domain. Case in point: Visual Basic and Delphi. I 
recently had to write a data-maintenance application in VB for a client.
I was supposed to deliver a prototype first, and because of 
procrastination I wound up having to write the prototype in one day. After
spending a couple of hours in VB, I despaired of getting the thing done 
in time and switched to Delphi (I have more experience in VB than Delphi).
Three hours later, I had a "prototype" that met all the specs for the
finished application. A month later, I delivered the VB version. Of 
course, it was slower, less robust, and far more difficult to maintain 
than the prototype, but it went into production because it was written in 
a politically correct language. 
  


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

Date: Mon, 14 Apr 1997 13:09:53 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: perl pattern matching
Message-Id: <adelton.861023393@aisa.fi.muni.cz>

> $a =
> "<ARTTIT>title-1</ARTTIT><LID>text1<LIST>listelement</LIST>text-continued</LID><ARTTIT>title-2</ARTTIT><LID>text2</LID><ARTTIT>title-3</ARTTIT><LID>text3</LID>";
> 
> the result must be:
> 
> <ARTTIT>title-1</ARTTIT>
> <ARTTIT>title-2</ARTTIT>
> <ARTTIT>title-3</ARTTIT>
> 
> I tried
> 
> $a =~ s|<LID>[\W\w]+</LID>||g;
> 
> but this  eats also the <ARTTIT>'s 
> 
> So, what's the best solution?

Use non-greedy matching:

s|<LID>[\W\w]+?</LID>||g;

or maybe s|<LID>.+?</LID>||g;

Hope this helps.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 14 Apr 1997 13:49:13 GMT
From: "Jxrgen Mxlbach" <jm@qsd.no>
Subject: Perl to Oracle on a NT-Server
Message-Id: <01bc48da$a3805be0$22265ac1@Symphonie.qsd.no>

Hi!

Can anyone tell me what I need (on the Linux-side) to complete a
communication between a Perl-program on Linux and an Oracle-server running
on NT.
Do I need SQLNet for Linux (SCO Unix)?
How do I use the DBD and DBI??

Please answer, I am in a great hurry...

-Jxrgen Mxlbach
Quick Software Development AS
Pb. 209, Oslo Norway
E-mail: jm@qsd.no
Web:http://www.qsd.no



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

Date: 14 Apr 1997 04:19:25 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Perl-Books.
Message-Id: <8csp0thmwy.fsf@gadget.cscaper.com>

>>>>> "I" == I R A Aggie <fl_aggie@hotmail.com> writes:

I> In article <E8JEnv.2HF@nonexistent.com>, abigail@fnx.com wrote:
I> + It makes me wonder, how suitable is Perl for teaching fundamental
I> + programming concepts? 

I> Not very. Perl will quite cheerfully hand you more than enough rope
I> to hang yourself.

And with the addition of references, objects, and prototypes, you not
only get enough rope, but they sell you the entire Hardware Store. :-)

Perl is a powerful tool in the hand of an expert.  A beginner might
have some difficulty.  Best to stay for a while with some toy
language, like Visual Basic or TCL. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 505 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
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@ora.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: Mon, 14 Apr 1997 10:29:41 -0500
From: Dale Manemann <manemann@dubuque.net>
Subject: Problem with code fragment
Message-Id: <33524D65.4A2F@dubuque.net>

Hello...
	I'm having a hell of a time trying to figure out a script that 
generates a hit report from a server log. This thing worked correctly for a 
few months and now it chokes. (It is possible that the file was overwritten 
with a previous version). The data hasn't changed. I can only guess that the 
problem is in the second if statement. But it looks OK to me:

#Begin example data from $datafile
205.139.56.102 - Sally [07/Apr/1997:00:00:32 -0400] "GET /usr.hts?id=311 
HTTP/1.0" 200 -
205.229.224.24 - - [07/Apr/1997:00:02:16 -0400] "GET / HTTP/1.0" 200 4545
207.48.110.35 - - [07/Apr/1997:00:04:42 -0400] "POST /search.cgi HTTP/1.0" 
200 641
#End example data from $datafile

#Begin code fragment
$logrec=$other=0;
if (open (FILE, "<" . $datafile))
{
  while (<FILE>)
  {
    if (m/(\d+\.\d+\.\d+\.\d+) \- (\-|\w+) \[(\d+\/\w+\/\d+:\d+:\d+:\d+) 
\-0500\] "(GET|POST|HEAD) (.*) HTTP.*" (\d\d\d) (\-|\d+)/)
    {
      $host=$1;$user=$2;$date=$3;$method=$4;$guts=$5;$ret=$6;$bytes=$7;
      #manipuate_parsed_info ...
      $logrec++;
    }
    else
    {
      $other++;
    }
}
#End code fragment

At the end, $other = #number_of_lines_in_datafile and $logrec=0

Any suggestions???

DRM


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

Date: 14 Apr 97 12:12:10 GMT
From: "Jerome R. Westrick" <jerry@gbs.ch>
Subject: Problems Building Perl WIN32 on NT
Message-Id: <01bc48cd$22508890$66ef49c1@gbspc02>

1- I've downloaded Pw32s306.zip from CPAN...
2- I've extracted the sources into "D:\Program Files\Perl5\..."
3- using Ms Visual C++ 4.2, I've opened and compiled the following
Projects:
	perl5i.mak			(Perl- Win32 Release)
	Ext\Fcntl\Fcntl.mak		(Fcntl- Win32 Release)
	Ext\FileHandle\FileHandle.mak	(FileHandle - Win32 Release)
	Ext\Io\Io.mak			(IO - Win32 Release)
	Ext\SDBM_File\Sdbm_file.mak	(SDBM_FILE - Win32 Release)
	Ext\Socket\Socket.mak		(Socket - Win32 Release)
	Ext\Win32\Win32.mak		(Win32 Extensions - Win32 Release)
    	Theese are all the makefiles I could find...
4- I change to the "D:\Program Files\Perl5\ntt" directory and run test...

Unfortunately, the test returns the following:

lib\soundex.........ok
lib\symbol..........ok
lib\texttabs........ok
lib\textwrap........ok
lib\timelocal.......FAILED on test 1
nt\eventlog.........ok
nt\netadmin.........FAILED on test 1
nt\nrs..............Error: Runtime exception
FAILED on test 2
nt\registry.........Warning: unable to close filehandle results properly.
ok
nt\unsupported......ok
Failed 3/110 tests, 97.27% okay.
Press any key to continue . . .
	 
Assuming that I'm not the only one attempting this,
and that it works elsewhere,
I've obviously either left some step out,
or the NT environment/installation is different.
can any one give me pointers, to where I should look?

Thanking everyone in advance,    Jerry

P.S.  I'm building from source since I wish to use the DATA::DUMPER module
        And it requires recompilation of the source.  Correct?




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

Date: 14 Apr 1997 07:16:57 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: QUESTION: hidden traps if blessing into container class?
Message-Id: <ysizbu7h7kq0.fsf@bufo.usc.edu>


1- Is there a module which allows for creating a has-relationship so
that the contained class knows it's container?

2- If not, would I get in some sort of hidden, undocumented trouble
for blessing my SgCensus objects as the class that is containing them?
I want to have a generic census object but use a file-scoped global
hash which increments the count of objects of each type based on what
is containing the census object.

-- 
o============o  Sending  unsolicited commercial e-mail (UCE) to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum for professional proofreading & technical assessment.
terrence brannon * brannon@kappa.usc.edu * http://rana.usc.edu:8376/~brannon


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

Date: 14 Apr 1997 08:40:15 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: QUESTION: hidden traps if blessing into container class?
Message-Id: <ysizd8rxtxya.fsf@bufo.usc.edu>

brannon@bufo.usc.edu (Terrence M. Brannon) writes:

> 1- Is there a module which allows for creating a has-relationship so
> that the contained class knows it's container?
> 
> 2- If not, would I get in some sort of hidden, undocumented trouble
> for blessing my SgCensus objects as the class that is containing them?

Well, yes. You will be able to call methods of the class you blessed
it into, but not methods of the class it was newed from


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

Date: Mon, 14 Apr 1997 12:07:53 +0100
From: cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <MPG.dbbfc2ec819953a98976b@news.demon.co.uk>

With a mighty <5irhvn$gm9@mimsy.cs.umd.edu>,
clin@cs.umd.edu uttered these wise words...

>     Some of these Dummies books are unfortunately, not very good.  Some
> authors think that if you use "cool" language and sound hip, you are
> talking to a dummy, even as they explain a fairly difficult concept.

Being "good" is not really the issue. I wish it was, but then we could 
just recommend books like SICP. It might help just to get a book about 
Lisp onto the bookshelves that talks the same language as the mass of 
books about C++, VB, etc.

Not that I'd want to assume that _anyone_ was a dummy. If they've 
bothered to read your book, at least credit  them with _something_. ;)

> But the nice thing is that the author writes the book with the dummy
> in mind.   Take Stroustrup's book on C++.   For a long time, I've said
> it's not a good book for dummies, but I hadn't seen the book in a long
> time, so I had forgotten what kind of things is said.   Having reread
> just the first few pages recently, he makes comments that only an
> experienced programmer would understand.   

I fully agree with you about this. Most programming books make this 
mistake, IMHO. I've been very impressed by the functional programming 
tutorials that I've read. I guess it's because they start from the 
absolute basics, assuming no prior programming knowledge and 
experience. There are many other books which assume that you already 
know how to program, and I think that Stroustrup's book on C++ is one 
of them.

To be fair, I don't think that he hides this. It's a reasonable way to 
write a tutorial, providing that you make it clear enough who the book 
is targetting. In this sense, it's like everything else: know your 
audience or you a failure to communicate.

There are some Lisp books that go to the other extreme, but I think 
that SICP's only failing in this respect is that it covers a heck of a 
lot of material, and moves _very_ fast. Too fast for "dummies", I bet.

In my collection of programming language tutorials, I have a number 
for Prolog. One is very thin, and apallingly bad at explaining 
anything, never mind Prolog. I bought it and keep it as an example of 
how _not_ to teach anything.

There are many ideas that need more than a single page, and some that 
could use several _chapters_. SICP could be looked at as a book that 
communicates a single very important idea, which is that code is also 
data, and data may be used as code. It teaches a lot more than that, 
but it's an idea that most tutorials don't even mention, never mind 
devote entire chapters to it.

OOP is also worth an entire book, esp if the language is supposed to 
be OO. I'd hope to see at least a single chapter focusing excusively 
on it, in a tutorial for an OO language. On the other hand, I've read 
some excellent books that communicate OO ideas in _every_ chapter, so 
perhaps it's not so easy, or desirable, to draw a clear line between 
material about the language and OOP techniques.

>     Winston wrote a book called Common Lisp, and he sort of has a
> dummies style of writing.   The headings of the individual sections
> are often sentences.   He keeps his sentences rather short.   He
> tries to use simple examples.   But for all that, it still reads
> more complicated than it seems it should.   Sort of like someone
> trying to explaing thermodynamics to kindergarterners in simple
> language, but still being more-or-less technically precise.   It's
> still a little hard to follow.    It shows up more in his book
> "On to C++".    I happen to like Touretsky's Lisp book better 
> even though it, too, is fairly elementary.   It reads a little
> better.   Winston's book has more stuff in it overall, however.

Unless you mean the tutorial he wrote with Horn, I've not read that 
one. The "W&H" book is an excellent tutotial, but like SICP, it also 
covers a lot of ideas and moves very fast.

However, if you don't think that math and AI problems will be of any 
use to you (err...), then a better book - for dummies - would be one 
that focuses more on the things that most programmers (dummies?) will 
recognise as familiar problems. How about an HTML search engine, 
complete with the socket code for fetching objects from a web server, 
or even a web server, complete with CGI meta-language, stats 
processing and reporting, etc. That should demonstrate many of the 
same techniques, but it would be _presented_ from an angle that most 
programmers will at least recognise, even if they _might_ have trouble 
understanding the code.

My guess is that they'll make more effort to understand what you're 
talking about if the problems are ones that they understand and want 
(better) solutions for. If you say, "Let's write a web server that 
allows us to modify the CGI code _without shutting down or unloading 
anything_", I bet that more programmers will be interested than if you 
offered them techniques for writing a natural language front end to a 
database - which is just one of things that W&H do in their book.

I'm not knocking W&H, as they wrote an excellent book IMHO, but I 
doubt that the subject matter will have the same "pull" as a book 
about writing Internet code. Perhaps that's the power of buzzwords. A 
phrase like "matural language" will likely turn off many people, while 
anything with "web" in it should at least catch their eye. Of course, 
because of the low quality of many Internet books, this will also turn 
off some other people.

How many books are there about Internet programming that don't use 
Perl, C++, Java, or VB? These aren't the only languages capable of 
creating such apps and servers. I smell an opportunity.
-- 
<URL:http://www.wildcard.demon.co.uk/> You can never browse enough
  Martin Rodgers | Programmer and Information Broker | London, UK
            Please note: my email address is gubbish.


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

Date: 14 Apr 1997 12:03:24 GMT
From: gary@wheel.tiac.net (Gary D. Duzan)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5it6ec$qrv@news-central.tiac.net>

In article <5it19k$n8k@m1.cs.man.ac.uk>,
Donal K. Fellows  <fellowsd.cs@man.ac.uk> wrote:
=>In article <334EDC93.2376@maths.anu.edu.au>,
=>Graham Matthews  <graham.matthews@maths.anu.edu.au> wrote:
=>[ Replying to JO ]
=>> I would like you ask you a question. You claim that the "everything is a
=>> string" approach is the be-all-and-end-all, the way to go, etc, etc. Why
=>> then has Tcl8.0 moved away from this philosophy?
=>
=>Semantically it hasn't.  It just now has a rather neat behind-the-scenes
=>way of caching the results of converting the value from a string into
=>something else (like a list or number) in case it gets used like that
=>again.  You never see this though.  It is transparent to the programmer
=>(unless you are coding an extension in C and want to use the faster
=>programming interface - you don't have to though) and all the user
=>sees are (sometines significantly) faster programs.

   I should point out that this is quite consistent with Ousterhout's
insistence that in operating systems everything is a file, as is
traditional in Unix. I was at SOSP 13, and he seemed rather stuck on
calling every possible OS interface a file (slight hyperbole), even if
it was useful to view it from another direction.
   Not that string representations are a bad thing. The Demeter system
has a rather nice feature that lets you build an LL(1) syntax along
with your class graph, which automatically builds a parser and printer
for objects that fit the graph. This can be used for distribution and
persistence, but it was designed to let you change the class graph
without changing the syntax, so your objects maintain the same external
representation.
   So I guess my point is that something may be a good idea, but any
good idea can be taken to an extreme.

                                      Gary D. Duzan
                         Humble Practitioner of the Computing Arts





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

Date: Mon, 14 Apr 1997 14:01:55 +0200
From: Vegard Bakke <vegardb@knoll.hibu.no>
Subject: Returning an array with hashes
Message-Id: <33521CB3.6AE0@knoll.hibu.no>

When I have an array with hashes in a subroutine, how can I return
it out to the calling procedure?

I have checked the data within the subroutine and it ok.
I returned it as a function value (is this the problem?),
and the Array still contain the right number of indexes, but
every index contains the last hash in the original array.
How come?


Vegard


-- 
                           Vegard Bakke,
                       vegard.bakke@hibu.no
               Kirkegata 9, 3600 Kongsberg, Norway

   "My spelling is Wobbly.  It's good spelling but it Wobbles, 
and the letters get in the wrong places."      --  Winnie the Pooh


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

Date: 14 Apr 1997 13:07:54 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Returning an array with hashes
Message-Id: <5ita7a$f1k@pirate.shu.edu>

Hello -

Vegard Bakke <vegardb@knoll.hibu.no> writes:

>When I have an array with hashes in a subroutine, how can I return
>it out to the calling procedure?

>I have checked the data within the subroutine and it ok.
>I returned it as a function value (is this the problem?),
>and the Array still contain the right number of indexes, but
>every index contains the last hash in the original array.
>How come?

You'd have to give us some code to look at.  For what it's
worth, here's a trivial (but working) example:

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

my $loh = getloh();  # $loh is a ref to a list of hashes

sub getloh() {
    my $l = [ { 'h1p1' => "hash 1, pair 1",
                'h1p2' => "hash 1, pair 2" },
              { 'h2p1' => "hash 2, pair 1",
                'h2p1' => "hash 2, pair 2" } ];
    return $l;
}

print $$loh[0]{'h1p1'};  # prints "hash 1, pair 1";


David Black
dblack@icarus.shu.edu


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

Date: 14 Apr 1997 11:16:23 GMT
From: Mr. Chow Wing Siu <wschow@Comp.HKBU.Edu.HK>
Subject: Running as root
Message-Id: <5it3m7$b1q$1@power42t.hkbu.edu.hk>

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

Hi, I write a C wrap program (setuid as root) to call a perl as root also.
However, inside the perl script, it has many system() calls, apparently,
it cannot run the system() calls as root.  How to fix it?

Thanks in advance.
- -- 
PGP PUBLIC KEY: https://www.comp.hkbu.edu.hk/~wschow/pgp.html
Key fingerprint = 15 C4 36 D6 EC CF 1D A4  7F D8 F9 EF 2E D7 32 A6

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBM1ISN73ixeOqBhAdAQGNAAP8D0pfTcXrcSP9hzSCqH6/LYiU/kIGjnAU
/W2UE+vruqaWFrDbMMvJo7A23UNpt/WtU42O19Q/Zl7arKRsntVvwDV+8nON248K
84e+1/Xeu5/QcvW2QDS/mDu65WBU05snUIPcRQg6R8r+dn7hHoxFma2BxmtM+IEy
td5S+HD5t04=
=j+IK
-----END PGP SIGNATURE-----


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

Date: Mon, 14 Apr 1997 14:46:30 -0700
From: Mark Grimshaw <Mark.Grimshaw@ucsalf.ac.uk>
Subject: sockets.pl library module for CGI
Message-Id: <3352A5B5.10F7@ucsalf.ac.uk>

Hi all,

Does anyone know the whereabouts of the Perl module 'sockets.pl' or
similar referred to in the CGI Programming on the World Wide Web book by
Shishir Gundavaram?

Please email:  Mark.Grimshaw@ucsalf.ac.uk
-- 
Mark Grimshaw
Salford University Music Department:
	http://www.salford.ac.uk/music/mushome1.htm


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

Date: Mon, 14 Apr 1997 07:04:48 -0700
From: Thant Tessman <thant@acm.org>
Subject: Re: Ugly Versus Elegant (Was: Reply to Ousterhout's reply)
Message-Id: <33523980.41C6@acm.org>

lvirden@cas.org wrote:
> 
> According to Thant Tessman  <thant@acm.org>:
>
> [...] And as someone
> :has already pointed out, Tcl is only popular because people refuse to give
> :up C++ and Tcl happens to address some of C++'s weaknesses.
> 
> I don't think this idea of why Tcl is popular isn't the general case.
> There probably are some folk who believe this way.  However, in general,
> the folk I come in contact with seem to use Tcl because a) the applications
> they want are written in Tcl/Tk, b) they want a very small, easy to teach
> to non-programmer, extension language for their application, or c) they
> want a small, easy to use, language for quickly putting together X
> Window system applications.  The most recent trend has been contact from folk
> who want a simple, quick, easy to use, NO COST, way to write GUIs for
> Windows.


In other words, people use Tcl because it is small, easy to learn, easy 
to use, and interactive--exactly the things C++ is not.

As others have pointed out, there are alternatives to C++ that don't have
these weaknesses, and consequently no need for a bandage like Tcl.

-thant


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

Date: 14 Apr 1997 11:22:55 GMT
From: Donal K. Fellows <fellowsd.cs@man.ac.uk>
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5it42f$ofj@m1.cs.man.ac.uk>

In article <01bc4755$d60b7a80$32ee6fcf@timhome2>,
Tim Behrendsen <tim@a-sis.com> wrote:
[ elided ]
> Unless they have dramatically improved ghostscript lately, it is
> not better than the "real thing", at least it always seems to have
> formatting problems when I try and use it.
[ elided ]

Which version were you using?  Prior to version 4, the distributed
fonts were awful.

[ 'ware followups ]

Donal.
--
Donal K. Fellows   http://r8h.cs.man.ac.uk:8000/  (SAY NO TO COMMERCIAL SPAMS!)
(work) fellowsd@cs.man.ac.uk     Dept. Comp. Sci, Univ. Manchester, U.K.
 |     donal@ugglan.demon.co.uk  6,Randall Place, Heaton, Bradford, U.K. (home)
 +-> ++44-161-275-6137  Send correspondence to my office  ++44-1274-401017 <-+


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

Date: 14 Apr 1997 15:25:52 GMT
From: "Santiago Alvarez Rojo" <santiago@gambito.com>
Subject: user authentification
Message-Id: <01bc48e8$28cf0640$7131a8c0@sg059pcs>

Are there any module to perform user authentification (username/password)
using /etc/passwd file.

TIA
Santiago

Ps. email reply will be appreciated.
-----------------------------------------------------------------
     Santiago Alvarez Rojo
        santiago@gambito.com
        http://www.gambito.com/santiago
                     PGP-key: http://gambito.com/santiago/pgp.txt
-----------------------------------------------------------------


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

Date: Thu, 10 Apr 1997 22:00:06 GMT
From: webmaster@componentweb.com (nick^)
Subject: Re: Working perl script... not running with HTTP get.
Message-Id: <334d62c8.325913@news.come.net.uk>

On Tue, 08 Apr 1997 10:25:04 GMT, webmaster@componentweb.com (nick^)
wrote:

>I have got a form to mail script working on my server. I cannot make
>any scripts I have written work in the same way from an HTTP GET.
>I have written a search script, which runs on my machine. I have had
>problems making the script run on the web server. To debug the cause,
>I have written a very simple script. It works when called from the
>IRIX command line but I get a server misconfiguration error when I use
>a submit button on a web browser form (Netscape/ MSIE). I have chmod
>755 the script.
>
>I expect "Hello World" to be displayed on the web browser when I do a
>GET from a web browser form.
>
>I get the "Server misconfiguration error..." message.
>
>Here's the script:
>#!/usr/bin/perl
># Program to do the obvious
>#
>print 'Hello world xxx.';           # Print a message
>
There are many helpful people on this newsgroup, Thank you for your
help.

I received a few replies pointing out the missing header.

The header was a problem, but there was a less obvious problem... I
edited the file in a win/dos editor which places ASCII 13,10 at the
and of the line, in the normal DOS fashion. This causes IRIX to
mis-interpret the file header and not run PERL.

I have now got the debugging program (hello world...) working.

I had another problem today where PERL on the IRIX kept hanging on the
program I have written. The problem was not shown by the -w or -wc
switch. I had to debug by cutting code out until I found the offending
piece (YUCK!).

I had two lines searching $_ and returning back to a specific foreach
if found thus:

if (/Dollar Values/) {next filecycle}
if (/<\/pre>/i) {next blockcycle}

The first searches for the string 'Dollar Values', the second for
'</pre>'or '</PRE>'. Both these lines of code were causing the program
to hang. (these both work OK on my perl5, 32 bit).

I overcame the hang by:

$crit1='Dollar Values';
$crit2='<\/pre>';
if (/$crit1/) {next filecycle}
if (/$crit2/i) {next blockcycle}

This is'nt a pretty way of coding, is there something wrong with my
syntax or with the PERL interpreter? Is there any way I can more
quickly debug such problems?


Regards

Nick.


>Parameters will be passed from the form to the URL to the environment
>and these will be ignored, Right? 
>
>Have i missed a basic requirement when using a perl script called with
>an HTTP GET, or should it run as I expect?
>
>Regards
>
>Nick.



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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 297
*************************************

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