[8928] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2546 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 9 08:08:31 1998

Date: Sat, 9 May 98 05:00:48 -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           Sat, 9 May 1998     Volume: 8 Number: 2546

Today's topics:
    Re: books for learning perl <gerhard@shadow.ccc.at>
        CPAN intended audience? (was Re: CPAN & Module gripes) (Earl Hood)
    Re: CPAN intended audience? (was Re: CPAN & Module grip (Mike Heins)
    Re: CPAN intended audience? (was Re: CPAN & Module grip <jhoglund@mirage.skypoint.net>
        Creating computer account <ehorton@airmail.net>
        Does Perl have a IDE?I don't like command line. <Xyujun@ppp.wzptt.zj.cn>
    Re: Grieving our dying community (Hakan Hjelmstrom)
    Re: Help ME <rootbeer@teleport.com>
    Re: How old is Perl? <Rosie@dozyrosy.demon.co.uk>
        How to treat a string as a perl command? (Franz Kaufmann)
    Re: How to treat a string as a perl command? <lanier@shell6.ba.best.com>
        linked lists <camennie@cantor.math.uwaterloo.ca>
    Re: linked lists <davidc@selectst.com>
    Re: Logic of split() ? (David A. Black)
    Re: Logic of split() ? <jgoldberg@dial-but-dont-spam.pipex.com>
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) <rootbeer@teleport.com>
    Re: MODULE MANIA STRIKES (Was Re: What does this do?) <danboo@negia.net>
    Re: perl scripts dealing with /etc/passwd (Hakan Hjelmstrom)
    Re: Using split to return a @ without splitting on spac <mmurdock@mail.Globalserve.net>
    Re: Using split to return a @ without splitting on spac (Craig Berry)
    Re: Win32::ODBC; NEW doesn't work <rootbeer@teleport.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 9 May 1998 09:15:06 +0200
From: Gerhard Poul <gerhard@shadow.ccc.at>
To: jason bass <jkbass@netnet.net>
Subject: Re: books for learning perl
Message-Id: <Pine.LNX.3.96.980509091203.29972B-100000@shadow.ccc.at>

Hi,

On Sat, 25 Apr 1998, jason bass wrote:

> hello i'm new to perl and i would like to know if there are any good
> books for learning perl

I don't read it but i think Perl for dummies is not a "real" book for
learning perl...

A very good book is "Learning Perl" from ORA... all books from them are
good of course ;-)

Just go on http://www.ora.com and use your mouse to go to the perl pages,
there you can find a big list of perl books... But "Learning Perl" is the
best for the beginner I think...

cu
 gerhard




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

Date: 7 May 1998 20:39:34 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: CPAN intended audience? (was Re: CPAN & Module gripes)
Message-Id: <6it666$7pl@news.service.uci.edu>

In article <pudge-0705980809320001@192.168.0.3>,
Chris Nandor <pudge@pobox.com> wrote:

>If you want to spend your time doing that, be my guest.  But I am
>convinced that anyone who is intelligent enough to program usefully will
>be able to figure CPAN out as-is with a minimal amount of thought and
>effort.  All they have to do is read the documents, browse around, and
>maybe ask a question or two, politely.  If they cannot do that, they
>cannot program.

This comment leads to the main (IMHO) question:

	"Who is CPAN's intended audience?"

If the audience is Perl developers, then there is validity in Chris'
statement.  However, and one of my criticisms of CPAN, is that it
implies *only* a Perl developer audience.  CPAN means "Comprehensive Perl
Archive Network".  Not "Comprehensive Perl Module Archive Network".
CPAN is designed not to just be a module archive, but an archive of
useful information, data, software, etc, related to Perl.  Hence, not
just programmers would use CPAN.  Contrary to what some may think, many
users of Perl software do not program Perl.  There are many useful
applications written in Perl that can be used by non-developers.

People are aware that Perl can do cool things, and that there are very
useful programs written in Perl.  However, if you are not a developer,
using CPAN provides little help in finding software that does not
require Perl programming knowledge.  There is software at CPAN that are
end-user applications, but there is no application index available
(btw, no index is available for non-official modules).  Sometimes I
wonder if it is worth my time to keep my author area updated with my
non-module software.  I know of alot of very useful applications
written in Perl not available at CPAN (eg Majordomo).

The lack of non-module data support has spawned all the "Perl tool"
sites to feel the void of cataloging applications developed using
Perl.  A problem with these sites (and I even maintain one) is that
they are decentralized.  Most of try to encourage the use of CPAN since
it is a "authority" on Perl related information.  However, its
authority is questionable in some areas, like ready-made programs.
There used to be a "scripts" area at CPAN to encompass applications,
but it is no longer maintained.  I would like to see an "application"
area (I do not like the word "scripts") comparable to the modules area,
and organize the listing for non-programmer types.

The top level page of CPAN should be structured with the following
types of major links:

    o   End-user area: List of useful applications developed in Perl,
	and how to install Perl for non-programmers (in-order to run
	those programs).  A good place for binary distributions
	of Perl.

    o	For developers: Module listings, docs, FAQs, applications and
	utilties, development tools, tutorials, etc.

By its nature, the module area should assume developer types so trying
to tailor it for non-developers is a waste of time, and would probably
frustrate developers having to deal with a non-developer friendly
interface.  (The developer area would be the biggest part of CPAN since
Perl is a programming language).

We must not forget that modules are nothing unless useful applications
exist that utilize them.  I believe Perl still has the stigma of a tool
language for developers and not as a language to develop end-user
applications.  I find Perl more suitable to write appplications than
Java, but you will probably find that the rest of the community will
not agree -- excluding the folks who frequent this newgroup (and Java
is being touted as an application development language).  Maybe CPAN is
not the appropriate medium to cater to the end-user community, but it
should be a suitable source for end-user applications (the "A" in
CPAN).  It will then provide help in showing that real applications can
be developed in Perl.

It would be nice to have the statement:

    "If it's written in Perl, and it's helpful and free, it's in the
     CPAN."
		-- CPAN.html, March 14, 1998

actually be true.  Not everything that is helpful and free is available
at CPAN.

It looks like I have drifted on-and-off subject, so I'll shut-up
now.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: 9 May 1998 02:38:44 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: CPAN intended audience? (was Re: CPAN & Module gripes)
Message-Id: <3553f9f4.0@news.one.net>

In comp.lang.perl.modules Earl Hood <ehood@geneva.acs.uci.edu> wrote:

[snip well-conceived statement]

> The lack of non-module data support has spawned all the "Perl tool"
> sites to feel the void of cataloging applications developed using
> Perl.  A problem with these sites (and I even maintain one) is that
> they are decentralized.  Most of try to encourage the use of CPAN since
> it is a "authority" on Perl related information.  However, its
> authority is questionable in some areas, like ready-made programs.
> There used to be a "scripts" area at CPAN to encompass applications,
> but it is no longer maintained.  I would like to see an "application"
> area (I do not like the word "scripts") comparable to the modules area,
> and organize the listing for non-programmer types.

Someone started a mail list at the Perl Institute for this back
in October, but nothing was ever followed up on. I joined the
list but never received any messages.

> It would be nice to have the statement:

>     "If it's written in Perl, and it's helpful and free, it's in the
>      CPAN."
> 		-- CPAN.html, March 14, 1998

> actually be true.  Not everything that is helpful and free is available
> at CPAN.

It can be true. I have placed applications there, and there ARE applications
there. Andreas is certainly open to putting them there.

As you have stated, the problem is that there is no corresponding series of
categories.

I am not privy to the linking mechanics that perform the categorization --
I presume they are automatically generated from the 02packages.details.txt
file and some category map (maybe it is 00modlist*).  In any case,
I would suggest a change to the PAUSE mechanism whereby:

    1. Anyone could point their application at up to three
    repository directories. As we currently have modules/by-module
    and module/by-category, we could have "apps/by-app" and
    "apps/by-category".

    2. Application maintainers can *create* these category
    directories to begin with. After a certain time, it will
    probably be seeded with a series of categories that may or
    may not make sense as a whole. At that time, the categories
    can be re-arranged and the category tree would be semi-fixed
    as the Module categories are now.

    3. Then generate the application list from the directories.
    perhaps an "ABSTRACT" file could be used to generate the
    application description.

I would be willing to take on the additions to the PAUSE -- I see
it as a simple script to present a series of existing directories in
the application area, along with an input to create a new one, and the
corresponding symlinking to the authors/ID directory. It could stand
alone, I think, and be just another option area on the PAUSE menu.

Since the resulting output would be a few directories and some
symlinks, this should not cause big problems for space or resources.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Just because something is           131 Willow Lane, Floor 2  | ||  _ \
obviously happening doesn't         Oxford, OH  45056         | || |_) |
mean something obvious is           <mikeh@minivend.com>     |___|  _ <
happening. --Larry Wall             513.523.7621 FAX 7501        |_| \_\


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

Date: 9 May 1998 11:56:43 GMT
From: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: CPAN intended audience? (was Re: CPAN & Module gripes)
Message-Id: <6j1g9r$dcb$1@shadow.skypoint.net>

In comp.lang.perl.misc Earl Hood <ehood@geneva.acs.uci.edu> wrote:
: In article <pudge-0705980809320001@192.168.0.3>,
: Chris Nandor <pudge@pobox.com> wrote:

: There used to be a "scripts" area at CPAN to encompass applications,
: but it is no longer maintained.  I would like to see an "application"
: area (I do not like the word "scripts") comparable to the modules area,
: and organize the listing for non-programmer types.

It's kind of interesting to see you post on this subject. I used to be a
big user of "man2html" as a program _AND_ I took snippets of code from it 
and re-incorporated them. To me, I'm usually more apt to tear apart
something thats already written and use a piece of it here or there as
opposed to using a module. (depending on the circumstances of course)

So, man2html was useful as more than an application, but also as more
than a programming tool. :-)  (incidently, the parts I took were the 
parts that converted url data to hash elements)

Thanks for writing it.

Jamie


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

Date: Sat, 09 May 1998 00:35:16 -0500
From: Ed Horton <ehorton@airmail.net>
Subject: Creating computer account
Message-Id: <5864DD7135E625F6.CE83CF06A75F6154.5A0A3A3C5ECE0EA1@library-proxy.airnews.net>

I am looking for a way to create a computer account on a PDC from a  NT
workstation.  Can this be done in perl?.
Thanks for any help
Ed



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

Date: 9 May 1998 11:28:19 GMT
From: "yujun" <Xyujun@ppp.wzptt.zj.cn>
Subject: Does Perl have a IDE?I don't like command line.
Message-Id: <01bd7bb8$2c54dd40$0100007f@yujun>

Does perl have a IDE(like  Turbo C2.0)?

Xyujun@ppp.wzptt.zj.cn
(remove X to reply)
yujun


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

Date: Sat, 09 May 1998 11:22:57 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: Grieving our dying community
Message-Id: <355635a6.8952513@news.algonet.se>

On Fri, 08 May 1998 14:35:42 +0100, Frank L. Quednau wrote:
> On a personal note I have to add that even as a newbie I managed to help 2
> or 3 people. Others have helped me, and I am very grateful about the fact
> that this group exists, as I love the idea of people helping Perl helping
> dogs being happy so people can help more people.

I couldn't agree more. Until recently I'd been lurking for quite some
time and feel like I really owe it to the group to contribute with
what I can. I also find that I can learn a lot from solving the
questions asked. 

> What about a bot that reads the newsgroups and checks for certain keywords 
> on which it generates automatic responses , like a link to the win32 faq, 
> the normal faq, or on some keywords (email attachment, e.g., showing 
> where to find MIME::Lite and my homepage) :) :):) !!!
> Once the bot is working properly people could simply ignore such questions
> and deal with the truly difficult ones.

I believe there's already a couple of autoresponders working in this
group, but how do you refrain people from being helpful by answering
anyhow? And again; Is this a bad thing? (answering FAQ's, that is)
To top it of, some of the more proficient users still might need to
keep an eye on all the "helpful but not clueless perl babytalkers" to
make sure we're not providing answers that are actually plain wrong.

Hekan Hjelmstrvm
hawk@algonet.se


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

Date: Sat, 09 May 1998 04:02:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Chris Schmidt <chris@starkimages.com>
Subject: Re: Help ME
Message-Id: <Pine.GSO.3.96.980508210228.11158B-100000@user2.teleport.com>

On Fri, 8 May 1998, Chris Schmidt wrote:

> Subject: Help ME

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

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



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

Date: Sat, 9 May 1998 11:02:05 +0100
From: Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk>
Subject: Re: How old is Perl?
Message-Id: <5YDiMVAdmCV1Ewi7@dozyrosy.demon.co.uk>

In article <355381E6.1BAD95E4@nortel.com>, John Beadles
<beadles@nortel.com> writes
>Tom Christiansen wrote:
>
>> 
>> PUMPKIN?
>> 
>>   [from Porting/pumpkin.pod in the Perl source code distribution]
>> 
>>   Chip Salzenberg gets credit for that, with a nod to his cow orker,
>>   David Croy.  We had passed around various names (baton, token,
>>   hot potato) but none caught on. Then, Chip asked:
>> 
>
>OK, so know we know what a pumpkin is.  What I want to know is what is
>a  cow orker?
>
>Come to think of it, maybe I don't want to know after all... ;-)
Yes you do - it's someone who orkes cows. Obviously.
:-)
Rosemary,
Just missing drowning her keyboard in coffee.
-------------------------------------------------------------------
| Rosemary I.H.Powell  EMail: Home: rosemary@dozyrosy.demon.co.uk |     
|                             Work: r.i.h.powell@rl.ac.uk         |
|                       http://www.netlink.co.uk/users/dozyrosy/  |
|                       http://www.dozyrosy.demon.co.uk/          | 
-------------------------------------------------------------------


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

Date: Sat, 09 May 98 10:55:00 gmt
From: ws97-868@wsrz1.wiso.uni-erlangen.de (Franz Kaufmann)
Subject: How to treat a string as a perl command?
Message-Id: <6j15m2$2ee$1@rznews.rrze.uni-erlangen.de>

Hello,

Suppose I have somehow assembled a string.How can I get perl to evaluate 
it as perl code?

Thanks



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

Date: Sat, 9 May 1998 03:26:10 -0700
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
Subject: Re: How to treat a string as a perl command?
Message-Id: <Pine.BSF.3.96.980509032446.28902A-100000@shell6.ba.best.com>

hello franz ( and all! )-

look at the eval() function, which allows you to execute arbitrary
strings within the current context.

you'll find all the details there...

m@
matt@lanier.org
matt@saturn5.com

> Suppose I have somehow assembled a string.How can I get perl to evaluate 
> it as perl code?



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

Date: Tue, 5 May 1998 15:21:36 GMT
From: Christopher Allan Mennie <camennie@cantor.math.uwaterloo.ca>
Subject: linked lists
Message-Id: <Pine.ULT.3.91.980505111949.16090A-100000@cantor.math.uwaterloo.ca>

	This is probably very much of a newbie question, but I'm trying 
to figure out how one would go about creating linked lists in Perl? Or 
perhaps all I need to know is what's a good way to insert data elements 
into the middle of an array (at whatever position...)? Sorry for my lack 
of understanding, any help is much appreaciated :).



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

Date: Sat, 09 May 1998 18:40:28 +1000
From: David Coldrick <davidc@selectst.com>
To: Christopher Allan Mennie <camennie@cantor.math.uwaterloo.ca>
Subject: Re: linked lists
Message-Id: <3554167B.FEB2CDA7@selectst.com>

You want splice, probably. But look at the doc for all of pop, push, shift,
splice, unshift.
No need for a linked list.

Regards,
David
splice ARRAY,OFFSET,LENGTH,LIST

splice ARRAY,OFFSET,LENGTH

splice ARRAY,OFFSET
     Removes the elements designated by OFFSET and LENGTH from an array, and
replaces them with the elements of LIST, if any. Returns the elements
     removed from the array. The array grows or shrinks as necessary. If
LENGTH is omitted, removes everything from OFFSET onward. The following
     equivalencies hold (assuming $[ == 0):

         push(@a,$x,$y)      splice(@a,$#a+1,0,$x,$y)
         pop(@a)             splice(@a,-1)
         shift(@a)           splice(@a,0,1)
         unshift(@a,$x,$y)   splice(@a,0,0,$x,$y)
         $a[$x] = $y         splice(@a,$x,1,$y);


     Example, assuming array lengths are passed before arrays:

         sub aeq {   # compare two list values
             local(@a) = splice(@_,0,shift);
             local(@b) = splice(@_,0,shift);
             return 0 unless @a == @b;       # same len?
             while (@a) {
                 return 0 if pop(@a) ne pop(@b);
             }
             return 1;
         }
         if (&aeq($len,@foo[1..$len],0+@bar,@bar)) { ... }



Christopher Allan Mennie wrote:

>         This is probably very much of a newbie question, but I'm trying
> to figure out how one would go about creating linked lists in Perl? Or
> perhaps all I need to know is what's a good way to insert data elements
> into the middle of an array (at whatever position...)? Sorry for my lack
> of understanding, any help is much appreaciated :).





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

Date: Fri,  8 May 1998 21:54:06 EDT
From: dblack@saturn.superlink.net (David A. Black)
Subject: Re: Logic of split() ?
Message-Id: <6j0cvu$beq$1@earth.superlink.net>

Hello -

"Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com> writes:

>This is far from vital information, but I'm curious about it now, and I
>couldn't see much of info in the perl docs:

>Why does:

> ( $time, $dummy, $day ) = split( /\s+(GMT on)?\s?/, $str );

>give the same as:

> ( $time, $dummy, $day ) = $str =~ /(\S*)\s+(GMT on)?\s?(.*)/;

>Is it a bug? or simply that the split function operates as a =~ regexp
>internally? What I was initially looking for was a split that would handle
>"time date" and "time GMT on date" equally - I had initially assumed that
>any bracketed expressions in a split would simply split, without entering
>the resulting array.

No, not a bug:


perldoc -f split

[...]
If the PATTERN contains parentheses, additional array elements are
created from each matching substring in the delimiter.
[...]


Also, have a look at perlre, especially the parts about lookahead assertions.


David Black
dblack@saturn.superlink.net


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

Date: Sat, 9 May 1998 11:52:32 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com>
Subject: Re: Logic of split() ?
Message-Id: <6j1cig$2qi$1@plug.news.pipex.net>

>   C:\> perldoc -f split

I don't seem to have perldoc, sadly... is it meant to come with the Windows
release?


>Use the non-capturing parens (?: foo ) as documented in perlre.


I will, thanks - it was just a matter of curiosity (I was using the 'args =
var =~ regexp' form anyway).

- Jeremy Goldberg




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

Date: Sat, 09 May 1998 06:23:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Scratchie <upsetter@ziplink.net>
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <Pine.GSO.3.96.980508220647.11158E-100000@user2.teleport.com>

On Fri, 8 May 1998, Scratchie wrote, referring to CGI.pm:

> I found a bug in it this week, 

Did you report it to the module's author? And did he confirm that it was a
bug? (Pardon me if I sound skeptical; most often when a "bug" is reported,
it's actually normal, documented behavior. But if you have found a true
bug and reported it to the author, you've done us all a service. Thanks!)

> and I still haven't found any bugs in
> cgi-lib.pl that keep me from using it.

Well, then, I won't tell you to stop using cgi-lib.pl for _that_ reason! 
:-) The important thing is that you're not trying to (re)implement it
yourself, with potentially buggy consequences. 

My biggest reason for recommending a module over cgi-lib.pl is that there
are potential problems with things like local()izing globals and variable
globbing. That it uses these things is not necessarily cgi-lib's fault, of
course, since it was written before Perl 5 gave us better ways to do those
things (namely, my() variables and true references).

Although new programs generally should be developed to use a modern module
instead of a library, there's nothing intrinsically wrong in using a
library.

Cheers!

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



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

Date: Sat, 09 May 1998 02:20:07 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: MODULE MANIA STRIKES (Was Re: What does this do?)
Message-Id: <3553F597.C6D4B93A@negia.net>

Michael J Gebis wrote:
> 
> Art Cohen <upsetter@shore.net> writes:
> 
> }Of course, you might be justified in pointing out that there is plenty of
> }documentation available to explain how the read function works, and that
> }it's a little lazy and annoying to post a question like that to this ng
> }without consulting said documentation first, but to proclaim -- simply on
> }the basis of one line of code -- that he *should* be using CGI.pm (simply
> }because it exists) is kind of idiotic.
> 
> I could agree with what you are saying for some
> other modules, but...
> 
> We're talking about CGI.pm, which has few (does it even have any?)
> dependencies, has awesome documentation, is easy to use, does
> all the common-but-tricky things correctly, and is a hell of a lot
> easier to maintain that anything else.  CGI.pm makes life easier
> for everyone.
> 
> So in other words, he really *should* be using CGI.pm.

i guess my problem with the suggestion of just 'use CGI' is that it
doesn't answer the question. the original poster didn't ask if there
was a better way to do it. he expressed a _desire_ to learn. let me
repeat that... "a _desire_ to learn." i say feed that desire. give
him an explanation or pointers to the documetation to chew on.

brian d foy's excellent CGI Meta FAQ:
  <URL:http://computerdog.com/CGI_MetaFAQ.html>

the perl distribution docs:
  man perlfunc
  man perlvar
  perldoc perlfunc
  perldoc perlvar
  perldoc -f read

sate his curiosity. do not make it obsolete.

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Sat, 09 May 1998 10:50:37 GMT
From: hawk@algonet.se (Hakan Hjelmstrom)
Subject: Re: perl scripts dealing with /etc/passwd
Message-Id: <35553195.7910184@news.algonet.se>

On Fri, 08 May 1998 10:03:41 -0400, David A. Lyons wrote:
> I've begun my project at http://g50mc.org/timeslips/ts.html
<snip>
> If you visit the web page and run it, you'll see it's "out of order". 
> 'realname' is the 7th entry, 'username' is the 4th.  Why wasn't
> 'realname' the 1st, 'username' the 2nd, etc...?

This is due to the way perl handles hashes internally. I can't really
give you details on it, but I guess searching the web for "hashing
algorithms" and such would turn up some helpful info.

> One more item:  How can I sort the contents of an associative array like
> %FORM in this case?  I have a Perl reference and looked up "sort()", but
> it's not very detailed, and I just don't get it!

You don't sort the hash itself but its keys when you use them. Use the
sort function together with the keys function for this.
Try this:

foreach (sort keys %FORM) {
    print "<li>$_ = $FORM{$_}\n"
}

The keys function showels all the keys of the hash into an array which
is then sorted by the sort function. The now sorted array is then
iterated over by setting $_ (check the perlvar docs for this variable)
to one array element at a time.

Hekan Hjelmstrvm
hawk@algonet.se


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

Date: Sat, 09 May 1998 00:00:06 -0400
From: Matt Murdock <mmurdock@mail.Globalserve.net>
Subject: Re: Using split to return a @ without splitting on spaces
Message-Id: <3553D4C6.93612F16@mail.Globalserve.net>

Tom Phoenix wrote:

> On Fri, 8 May 1998, Matt Murdock wrote:
>
> >         ($full_name, $blah) = split /,/, $pwent[6];
> >         @gecos = split /,/, $pwent[6];
>
> > If you print $full_name and $gecos[0], the result is NOT THE SAME!
> > $full_name will be the COMPLETE name, while $gecos[0] will be the FIRST
> > NAME ONLY!.
>
> You don't need to SHOUT! :-)
>
> Is this really true? Can you set @pwent (or $pwent[6]) to some known data,
> run your code above, and get this to happen? I can't...

    You are right.  The problem I was having is *not* what I described.  I
was trying to print the array, such as:

print "$_\n" while( <@gecos> );

    The above code acts as I described, where each array element seems to be
broken up by the spaces in the data, not by true list elements.  However,
what I described was not accurate, as you kindly pointed out!  At any rate, I
now know how to access the data I want, but am left with another question:
Why does the above code not print each list element individually?

> Of course, split is documented to work differently when splitting into a
> literal list, but I don't think that's what you're seeing. Are you certain
> that you are running the code you've given us? Hope this helps!

    It did help.  Thanks!

Matt Murdock



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

Date: 9 May 1998 06:45:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Using split to return a @ without splitting on spaces
Message-Id: <6j0u2k$k14$1@marina.cinenet.net>

Matt Murdock (mmurdock@mail.Globalserve.net) wrote:
: Tom Phoenix wrote:
[snip]
: > Is this really true? Can you set @pwent (or $pwent[6]) to some known data,
: > run your code above, and get this to happen? I can't...
: 
:     You are right.  The problem I was having is *not* what I described.  I
: was trying to print the array, such as:
: 
: print "$_\n" while( <@gecos> );

What's that globbing operator <> doing in that while condition??  Also, 
while over a list doesn't magically iterate like it does over a 
<FILEHANDLE>.  What you probably mean is

  foreach (@gecos) { print "$_\n" }

What's actually happening the way you have it written is that <@gecos> is 
globbing the contents of @gecos, and assigning them one at a time to $_ 
on each loop iteration.  Kinky...

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Sat, 09 May 1998 04:06:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Dmitri Budchenko <dmitri-b@usa.net>
Subject: Re: Win32::ODBC; NEW doesn't work
Message-Id: <Pine.GSO.3.96.980508210602.11158C-100000@user2.teleport.com>

On 8 May 1998, Dmitri Budchenko wrote:

> The following line always returns False:
> 
> if (!($O1 = new Win32::ODBC($DSN1))){....

That's what I'd want the if-test to return. Are you sure you wish
otherwise? 

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



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

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

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