[12253] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5852 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 1 18:07:17 1999

Date: Tue, 1 Jun 99 15:00:25 -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           Tue, 1 Jun 1999     Volume: 8 Number: 5852

Today's topics:
        "How to" install perl on an NT4 Server <mikeyway@otw.com>
    Re: "How to" install perl on an NT4 Server (Larry Rosler)
    Re: answering my own question <gbartels@xli.com>
    Re: Anyone know what is this script line meaning ?? <gellyfish@gellyfish.com>
    Re: bareface ratio (the psychology of newsgroups) <info@sundialservices.com>
        bareface ratio <gbartels@xli.com>
    Re: Better than Perl (D. J. Birchall)
    Re: Better than Perl <hippie@net-alert.com>
        CGI Newbie <philh@stalag13.com>
        definition of public domain <gbartels@xli.com>
        formatting number output (James Stevenson)
    Re: formatting number output (Andrew Johnson)
    Re: formatting number output (James Stevenson)
    Re: hey p5p! Bug w/proto (\@)? <uri@sysarch.com>
    Re: hey p5p! Bug w/proto (\@)? (Andrew Allen)
        How do I connect to a OracleDB from a website? !!PLEASE <buster.bunny@rocketmail.com>
    Re: how to eliminate double counting for hit counter <tchrist@mox.perl.com>
    Re: Implementing a MSNBC-like Voting mechanism <bill@fccj.org>
    Re: Making Perl Wait <cassell@mail.cor.epa.gov>
    Re: Newbie Q: how to build html table w/ cgi.pm (Dave Cross)
        parsing HTML (Steve)
        pipes?? (James Stevenson)
        Q: Alphabetical Indexing <m-andric@students.uiuc.edu>
    Re: Q: Alphabetical Indexing (Larry Rosler)
    Re: Q: Alphabetical Indexing <cassell@mail.cor.epa.gov>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 01 Jun 1999 20:47:14 GMT
From: "Mike S." <mikeyway@otw.com>
Subject: "How to" install perl on an NT4 Server
Message-Id: <37540e0d.0@news.otw.com>

Please pardon my "newbie" status at Perl.  Once you have downloaded perl and
installed a compiler what's the next step?  Any pointers would be
appreciated!  Please help :)




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

Date: Tue, 1 Jun 1999 14:12:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: "How to" install perl on an NT4 Server
Message-Id: <MPG.11bdec8654577472989b4f@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37540e0d.0@news.otw.com> on Tue, 01 Jun 1999 20:47:14 GMT, 
Mike S. <mikeyway@otw.com> says...
> Please pardon my "newbie" status at Perl.  Once you have downloaded perl and
> installed a compiler what's the next step?  Any pointers would be
> appreciated!  Please help :)

1.  Go to a command prompt.  Type 'perl -v<return>'.  You should get a 
version report.

2.  Write a file containing:

#perl -w
use strict;

print "Hello, world!\n";


>From the command line, type 'perl your_file<return>'.  It should speak 
back to you.

3.  From the Start menu, go to the ActivePerl group, click on 'Online 
Documentation', and 'have the appropriate amount of fun!'

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


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

Date: Tue, 01 Jun 1999 15:41:41 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: answering my own question
Message-Id: <37543775.1F18B455@xli.com>

I should have footnoted that I was recalling the definitions from
memory, and possibly added that I'm not a lawyer, nor offering legal
advice.

I'll re-check the book tonight, and see what it actually said.

Greg


I R A Aggie wrote:
> 
> On Tue, 01 Jun 1999 10:30:41 -0400, Greg Bartels <gbartels@xli.com>, in
> <3753EE91.AF4ADF31@xli.com> wrote:
> 
> + public domain - no copyright, can be copyrighted
> +       thereby taking what was once public domain
> +       out of the public domain. **not good**
> 
> Ummm...no. Once public domain, always public domain. To be certain, I
> can take a PD source, make modifications and make my own release policy,
> as my additions *are* mine. But I can't go around to FTP sites and other
> archives and demand they remove the original PD code, as that is NOT
> mine.
> 
> James


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

Date: 1 Jun 1999 19:43:02 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <7j1d46$e5$1@gellyfish.btinternet.com>

On Mon, 31 May 1999 15:02:43 -0700 David Cassell wrote:
> [courtesy cc to poster]
> 
> Austin Ming wrote:
>> 
>> [snip of other code]
>> --> @files = grep { $_ !~ m/^\./} readdir(DIR);
>> 
>> Anyone know what is this script line meaning ??
> 
<snip>
> 
> In regard to your question, it uses grep() to screen
> out certain files from the list coming out of readdir().
> Check out the grep() function in perlfunc for more
> details.  But the code drops every file and directory
> in DIR which starts with a period.  Which is usually
> the wrong thing to do.  
> 

Aw.  He (the original programmer that is) might be wanting to emulate
the behaviour of 'ls' - Actually I posted a bit of code here the
other day that did just this *deliberately*.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 01 Jun 1999 14:42:51 -0700
From: Sundial Services <info@sundialservices.com>
Subject: Re: bareface ratio (the psychology of newsgroups)
Message-Id: <375453DB.3748@sundialservices.com>

Greg Bartels wrote:
> 
> just an interesting phenomenon I've noticed
> on newsgroups in general.
> 
> bareface ratio:
> 
> the number of people who respond
> to tell you your information is wrong
> 
> versus
> 
> the number of people who respond
> to your requests for information
> on the same topic.
> 
> this seems to be about 3 (or more) to 1,
> depending on the topic.
> 
> so, if you have a question, and no one
> is responding, you can still get the
> answer, all you have to do is make something
> up first (bareface it), and the
> corrections will flood in.
> 
> Greg


A disturbingly astute observation, Greg.  Maybe we all should take the
lesson that the signal-to-noise ratio of the newsgroup would be improved
three-to-one if flamers simply ... didn't.

"Silence is efficient."


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

Date: Tue, 01 Jun 1999 16:05:39 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: bareface ratio
Message-Id: <37543D13.109FD1C8@xli.com>

just an interesting phenomenon I've noticed
on newsgroups in general.

bareface ratio:

the number of people who respond
to tell you your information is wrong

versus 

the number of people who respond
to your requests for information
on the same topic.


this seems to be about 3 (or more) to 1,
depending on the topic.

so, if you have a question, and no one
is responding, you can still get the
answer, all you have to do is make something
up first (bareface it), and the 
corrections will flood in.

Greg


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

Date: 1 Jun 1999 20:37:21 GMT
From: djb.perl@digitalfm.com (D. J. Birchall)
Subject: Re: Better than Perl
Message-Id: <slrn7l8h0p.46g.djb.perl@v2000.scream.org>

I R A Aggie <fl_aggie@thepentagon.com> wrote:

> Well, if he would use more of a hook...like how this "unicon" is better,
> and why I should burn my perl books to pick this up...

And here I thought Unicons were just mythical beasts. :)

-Dan

-- 
Dan Birchall, Vice President, Digital Facilities Management
Internet/Extranets/E-Commerce - http://www.digitalfm.com/
Hosting the bright ideas of M&M Lighting - http://www.mmlight.com/


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

Date: Tue, 1 Jun 1999 16:14:27 -0500
From: "Jim Davis" <hippie@net-alert.com>
Subject: Re: Better than Perl
Message-Id: <928271582.194.60@news.remarQ.com>

D. J. Birchall wrote in message ...
>I R A Aggie <fl_aggie@thepentagon.com> wrote:
>> Well, if he would use more of a hook...like how this "unicon" is better,
>> and why I should burn my perl books to pick this up...
>And here I thought Unicons were just mythical beasts. :)


Maybe he should be posting to comp.virgin.programmers instead?

Jim
--





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

Date: Tue, 01 Jun 1999 20:59:55 GMT
From: phil hoyt <philh@stalag13.com>
Subject: CGI Newbie
Message-Id: <375449CA.F4233034@stalag13.com>

I just want a simple droplet to decode info sent via email with the
method "post". Information on tbis subject is hard to track down and
most of it is for posting directly via http. 
Any suggestions would be helpful including URLs to check out or
alternate newsgroups I should be sending this to.


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

Date: Tue, 01 Jun 1999 15:50:12 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: definition of public domain
Message-Id: <37543974.B1DC9BB5@xli.com>


the following definition is taken from 
O'Reilly's book, "Open Sources"

(asterisks added by me.)

Public Domain

A common misconception is that much free software 
is public-domain. This happens simply because the 
idea of free software or Open Source is confusing 
to many people, and they mistakenly describe these
programs as public-domain because that's the closest 
concept that they understand. The programs, however, 
are clearly copyrighted and covered by a license, 
just a license that gives people more rights
than they are used to. 
A public-domain program is one upon which the author 
has deliberately surrendered his copyright rights. 
It can't really be said to come with a license; it's 
your personal property to use as you see fit.
Because you can treat it as your personal property, 
you can do what you want with a public-domain program. 
You can even re-license a public-domain program, 
removing that version from the public domain, or
you can remove the author's name and treat it as 
your own work. 
If you are doing a lot of work on a public-domain 
program, consider applying your own copyright to 
the program and re-licensing it. For example, if 
you don't want a third party to make their own
modifications that they then keep private, apply 
the GPL or a similar license to your version of 
the program. ***The version that you started with will 
still be in the public domain, but your version will 
be under a license that others must heed if they use 
it or derive from it.***
You can easily take a public-domain program private, 
by declaring a copyright and applying your own license 
to it or simply declaring "All Rights Reserved." 


John Callender wrote:
> 
> Greg Bartels <gbartels@xli.com> wrote:
> 
> > As it happend, I was at the bookstore
> > this weekend, browsing for a copy of
> > "The Mythical Man-Month" when I happened
> > across an O'Reilly book with the title
> > "Open Sources", with a big sticker
> > saying it was a "New Release".
> 
> > if it isn't a book for everyone on this list,
> > it is at the very least a book anyone should
> > read before evangilizing for or against
> > open source.
> 
> The full book is now available online, by the way. See:
> 
> http://www.oreilly.com/catalog/opensources/book/toc.html
> 
> --
> John Callender
> jbc@west.net
> http://www.west.net/~jbc/


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

Date: Tue, 1 Jun 1999 20:52:13 +0100
From: James@linux.home (James Stevenson)
Subject: formatting number output
Message-Id: <slrn7l8efd.t1b.James@linux.home>

Hi

well the subject asks all
how do i format numeric output

i keep getting stuff like 12.963333333333333

want it more like 12.96

thanks

-- 
---------------------------------------------
Check Out: http://www.users.zetnet.co.uk/james/
E-Mail: mistral@zetnet.co.uk
  8:50pm  up 2 days,  1:33,  2 users,  load average: 0.00, 0.03, 0.06


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

Date: Tue, 01 Jun 1999 20:20:19 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: formatting number output
Message-Id: <7gX43.37574$tE.287477@news2.rdc1.on.home.com>

In article <slrn7l8efd.t1b.James@linux.home>,
 James Stevenson <James@linux.home> wrote:
! Hi
! 
! well the subject asks all
! how do i format numeric output
! 
! i keep getting stuff like 12.963333333333333

check the FAQ's, specifically:

perlfaq4.pod: Why am I getting long decimals (eg, 19.9499999999999)
              instead of the numbers I should be getting (eg, 19.95)?

regards
andrew


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

Date: Tue, 1 Jun 1999 22:07:33 +0100
From: James@linux.home (James Stevenson)
Subject: Re: formatting number output
Message-Id: <slrn7l8isl.u3c.James@linux.home>

Hi

so where are the FAQS??

thanks

On Tue, 01 Jun 1999 20:20:19 GMT, Andrew Johnson <andrew-johnson@home.com> wrote:
>In article <slrn7l8efd.t1b.James@linux.home>,
> James Stevenson <James@linux.home> wrote:
>! Hi
>! 
>! well the subject asks all
>! how do i format numeric output
>! 
>! i keep getting stuff like 12.963333333333333
>
>check the FAQ's, specifically:
>
>perlfaq4.pod: Why am I getting long decimals (eg, 19.9499999999999)
>              instead of the numbers I should be getting (eg, 19.95)?
>
>regards
>andrew


-- 
---------------------------------------------
Check Out: http://www.users.zetnet.co.uk/james/
E-Mail: mistral@zetnet.co.uk
 10:00pm  up 2 days,  2:43,  2 users,  load average: 0.00, 0.00, 0.00


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

Date: 01 Jun 1999 16:07:05 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: hey p5p! Bug w/proto (\@)?
Message-Id: <x7btezelcm.fsf@home.sysarch.com>

>>>>> "BH" == Bill Huston <bhuston@eden.com> writes:

  BH>     sub s1 (@) {
  BH>       ...play with @_
  BH>     }

  BH>     sub s2 (\@) {
  BH>       ... play with ref to array
  BH>     }

  BH> That is...  

  BH>    s1(@foo);  # works  
  BH>    s2(@foo);  # works     

  BH> (Note: These seem to work identically, except for the 
  BH>  syntax inside the sub. Both can even change calling array!!!)

  BH> So, (because of the builtin behavior... see above) it makes me want 
  BH> to believe that these would work too:
   
  BH>    s1( (1,2,3) ); # works
  BH>    s2( (1,2,3) ); # Bzzzzz... compile error

but s2 is expecting an array ref so it fails here. passing @foo works
since the prototype can convert a named array to an array ref at compile
time. (1,2,3) is a list and is passed as a list of values. where can
perl deduce that it should be a single array ref or multiple array refs?
what if the values were:

	([1], [2], [3])

should that be converted to

	[ [1], [2], [3] ]

or passed as 3 array refs like it is now?

so you must get the difference between a named array argument and a
plain list. they are not the same with prototypes as the are not the
same with push, pop, @foo in scalar context, etc. named arrays are
compile time objects, lists are not.

  BH> I think if the behavior of (\@) [or some new proto character]
  BH> could be enhanced to provide the sub a reference to any list-like 
  BH> thing passed into it (perhaps read-only), it would make subs much 
  BH> more powerful.

again, how can you tell what the caller means when passing those two
things above?  perl can't tell so your sub code must do some work.

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


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

Date: 1 Jun 1999 21:29:05 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: hey p5p! Bug w/proto (\@)?
Message-Id: <7j1jb1$sc6$1@fcnews.fc.hp.com>

Bill Huston (bhuston@eden.com) wrote:
: Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
: : Bill Huston <bhuston@eden.com> wrote:

: : >    mysub ( @a1, @opts );           # array
: : >    mysub ( (1,2,3), @opts);        # literal list
: : >    mysub ( returns_list(), @opts); # sub() returns list
: : >    mysub ( keys %h, @opts);        # perlfunc returns list

: : There is no way to cleanly do this. 

: I was afraid of that. I'm still playing with (\*) ...

: : No.  Not even Perl builtins can do this.  I'm not even sure what
: : "builtin behavior" you refer to above.

: I'm refering to how when passing a list-like thing to most perlfuncs
: which take such, one can use an array, a literal list, a sub (or another
: perlfunc) which returns a list. Examples:

:   join (":", @list);                  # all 
:   join (":", returns_list());         #    these
:   join (":", qw(literal list));       #      work
:   join (":", ("literal", "list2"));   #        just
:   join (":", keys %h);                #           fine

It's not a list-like thing. It's a list. Pure and simple.

print prototype "CORE::join"
$@

Andrew


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

Date: Tue, 01 Jun 1999 20:34:25 GMT
From: Berni <buster.bunny@rocketmail.com>
Subject: How do I connect to a OracleDB from a website? !!PLEASE URGENT!!
Message-Id: <375443E0.6812F22E@rocketmail.com>

Hi all!

I'm a bloody newbie and have a urgent and for me really important
question:

*How do I connect form a webpage to a OracleDB?

I understand that it is necessary to put the appr. code in the
perlscript I'm using but how do I send and receive data form my
db/table? How do I code the nec. location/login?

Hope that sounds not to weird...
If there is any good docu (possibly in german) than please pinpoint me
to it!

Many thanks
    Bernhard

PS: Please reply also by mail - thanks!



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

Date: 1 Jun 1999 15:16:02 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to eliminate double counting for hit counter
Message-Id: <37544d92@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, Gareth Rees <garethr@cre.canon.co.uk> writes:
:As others have explained, you can't identify individuals.  But you can
:get a count of the number of different IP addresses that have accessed
:your page by examining your web server's access log.  

No, you can't.  The method proposed is deceptive, and not just due to
real machines.  You're forgetting proxies (sometimes second-level caches
and chaining, too) and browser-level caching.  Better to plead guaranteed
ignorance than to believe a facile lie.

Consider this not uncommon situation: I have more something handful and
a half of random machines scattered across four different subnets, a
couple dozen or so random users, an aggressively caching proxy with a big
filesystem to fill up, and per-client caches as well.  The Mac tends be
communal.  I refuse to provide cookies, referrer, or browser information.

So these all look the same by the most common method, thus proving how
truly inaccurate this is, and why it's an idiotic vanity device to waste
your life on "hit counters".

Professionals don't need hit counters.

--tom
-- 
WANTED: Dead or Alive -- Schrodeinger's Cat


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

Date: Tue, 01 Jun 1999 17:58:59 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Implementing a MSNBC-like Voting mechanism
Message-Id: <3754575d.0@usenet.fccj.cc.fl.us>

In article <Pine.GSO.3.96.990601104728.4138A-100000@tree0.Stanford.EDU>, 
Lewis Lin <lewie@leland.Stanford.EDU> wrote:


> I would like to replicate this mechanism using Perl.  What is the best way
> of doing this?  SQL Database which keeps track of all user IP addresses
> and a bit which keeps track if they've voted on a particular story?  Or is
> there something I can do with cookies?


Well, what is msnbc using?

SQL or cookies?

/^Humor$/
-Sneex-  :]
______________________________________________________________________
Bill Jones  Data Security Specialist  http://www.fccj.org/cgi/mail?dss
Need to get started in Perl? See http://jacksonville.pm.org/Letter.cgi



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

Date: Tue, 01 Jun 1999 13:49:21 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Making Perl Wait
Message-Id: <37544751.15E5FF78@mail.cor.epa.gov>

Greg Bacon wrote:
> 
> In article <37542516.3482E998@mail.cor.epa.gov>,
>         David Cassell <cassell@mail.cor.epa.gov> writes:
> : But seriously folks, I don't see how one can cover all the
> : possible permutations of function names and (mis)features
> : when someone moves to a new language.. say, Perl.  Not
> : everyone learns programming on a unix system.  And it seems
> : like most of the people who visit this ng are self-taught..
> : and usually on win32 boxes.  Which isn't their fault when
> : they're still trying to *learn*.  Only later when they should
> : have learned better.  :-)
> 
> sleep() is specific to neither Unix nor Perl.

Yes, and initial ignorance is specific to neither Unix nor Perl
as well.  My point was lost somewhere in there, I'm afraid.
I wanted to say that someone might just be in the position of
not knowing where in the docs to look, rather than being
unwilling or unable to do so.  Or perhaps Plato was thinking
of me: |
       |
       \/
> A wise man speaks because he has something to say, a fool because he has to
> say something.
>     -- Plato
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 01 Jun 1999 20:05:24 GMT
From: dave@dave.org.uk (Dave Cross)
Subject: Re: Newbie Q: how to build html table w/ cgi.pm
Message-Id: <37573c67.877376@news.demon.co.uk>

On Tue, 01 Jun 1999 18:26:02 GMT, Barista@End.Of.Universe (Ken Bass)
wrote:

>This has got to be a simple question:
>
>I want to output a table, where each row in the table is generated at
>run time. I have looked through the docs, and found the "table"
>function. But it seems (at least to me) that each row has to be
>specified individually.
>
>Did I miss something?  Do I need to just generate the tags myself? Can
>(should?) this be done with some format statements? 
>
>Could someone give me some sample code to just spit out a table
>(possibly with a header) that has, say, three columns ( 'a', 'b', 'c')
>and a few rows of dummy values? I would be much obliged.

There's a pretty good example in the CGI.pm docs.

print table({-border=>undef},
           caption('When Should You Eat Your Vegetables?'),
           Tr({-align=>CENTER,-valign=>TOP},
           [
              th(['Vegetable', 'Breakfast','Lunch','Dinner']),
              td(['Tomatoes' , 'no', 'yes', 'yes']),
              td(['Broccoli' , 'no', 'no',  'yes']),
              td(['Onions'   , 'yes','yes', 'yes'])
           ]
           )
        );

Dave...

--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>


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

Date: 1 Jun 1999 21:22:38 GMT
From: stevenh@erols.com (Steve)
Subject: parsing HTML
Message-Id: <7j1iuu$8hn$2@autumn.news.rcn.net>


I am new to Perl, and I'm working on a program to parse fairly simple HTML 
files and convert their content to plain text files for use by another system. 
 I posted an earlier question regarding the use of the .* characters in a 
substitution command.  While reading more info, however, I saw several 
references to a package called HTML::Parser.

What is this?  Is it freeware/shareware?  How do I get and use it?  Is there a 
URL where I can find out more about this?  It sounds like something that has 
already been written to do a lot of what I am trying to do.

Thanks in advance for any help!

Steve



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

Date: Tue, 1 Jun 1999 21:25:51 +0100
From: James@linux.home (James Stevenson)
Subject: pipes??
Message-Id: <slrn7l8gef.tjr.James@linux.home>

Hi

i am trying to exec an external program
am i need to read the data that it prints to the STDOUT
how can i do this and is it down with pipes??

thanks

-- 
---------------------------------------------
Check Out: http://www.users.zetnet.co.uk/james/
E-Mail: mistral@zetnet.co.uk
  9:20pm  up 2 days,  2:03,  3 users,  load average: 0.27, 0.17, 0.10


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

Date: Tue, 1 Jun 1999 15:44:30 -0500
From: milan andric <m-andric@students.uiuc.edu>
Subject: Q: Alphabetical Indexing
Message-Id: <Pine.SOL.3.96.990601153426.8576A-100000@ux13.cso.uiuc.edu>


I'm working on a script to create a html page from a (.csv) file and
update several index pages.  Right now, i have the pages looking the way i
want them to, but i can't come up with a good algorithm to keep the
indexed resources alphabetized while adding a new link to it. 

Basically i'm wondering if something already exists in perl (a function)
that alphabetizes.. if not, what is my approach?  comparing strings from
each line and formatting accordingly.. (sounds rather complicated, i think
there's something out there)  so i'm looking around..

thanks for any help,
m-andric@uiuc.edu



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

Date: Tue, 1 Jun 1999 14:03:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: Alphabetical Indexing
Message-Id: <MPG.11bdea61cb0746a4989b4e@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <Pine.SOL.3.96.990601153426.8576A-100000@ux13.cso.uiuc.edu> 
on Tue, 1 Jun 1999 15:44:30 -0500, milan andric <m-
andric@students.uiuc.edu> says...
> I'm working on a script to create a html page from a (.csv) file and
> update several index pages.  Right now, i have the pages looking the way i
> want them to, but i can't come up with a good algorithm to keep the
> indexed resources alphabetized while adding a new link to it. 
> 
> Basically i'm wondering if something already exists in perl (a function)
> that alphabetizes.. if not, what is my approach?  comparing strings from
> each line and formatting accordingly.. (sounds rather complicated, i think
> there's something out there)  so i'm looking around..

How hard are you looking?  Perl would be a pathetic general-purpose 
programming language if it didn't have a facility that alphabetized, 
wouldn't it?

perldoc -f sort

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


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

Date: Tue, 01 Jun 1999 14:23:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: milan andric <m-andric@students.uiuc.edu>
Subject: Re: Q: Alphabetical Indexing
Message-Id: <37544F57.3B93D922@mail.cor.epa.gov>

[courtesy cc sent to poster]

milan andric wrote:
> 
> I'm working on a script to create a html page from a (.csv) file and
> update several index pages.  Right now, i have the pages looking the way i
> want them to, but i can't come up with a good algorithm to keep the
> indexed resources alphabetized while adding a new link to it.
> 
> Basically i'm wondering if something already exists in perl (a function)
> that alphabetizes.. if not, what is my approach?  comparing strings from
> each line and formatting accordingly.. (sounds rather complicated, i think
> there's something out there)  so i'm looking around..

If you're storing your data in an array or hash, then all you
need to do is to look up the function sort() in your perlfunc
section (via man, perldoc, a browser if you have the HTML also,
 ...)  You might also want to look in the FAQ for the question:
"How do I sort an array by (anything)?" as well as the URL:
 http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html  .

If you're not storing your data as above, then you need to give
us more information, so we can give you some adequate advice.
Perhaps a 10 or 20 line program that encapsulates your issues.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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