[11144] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4744 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 25 14:57:29 1999

Date: Mon, 25 Jan 99 11:00:19 -0800
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, 25 Jan 1999     Volume: 8 Number: 4744

Today's topics:
        Arrays vs Hashes. jambutter@my-dejanews.com
    Re: Can you pattern match using an array? (Ilya Zakharevich)
    Re: Difficult issues not suitable for this newsgroup? (Andrew M. Langmead)
    Re: File Upload. (Sam Curren)
    Re: Getting the last number in an IP addr with a regex. droby@copyright.com
    Re: HELP: Compiling Perl for Dynamic Module Loading (Greg Ward)
    Re: Perl Criticism [summary] <dgris@moiraine.dimensional.com>
    Re: Perl Criticism [summary] topmind@technologist.com
    Re: Perl Criticism [summary] <staffan@ngb.se>
    Re: Perl Criticism (John Moreno)
    Re: Perl Criticism droby@copyright.com
    Re: Perl Criticism topmind@technologist.com
    Re: Perl Criticism <james.b.crigler@lmco.com>
    Re: Perl Criticism <staffan@ngb.se>
    Re: Personal lib dir - please help (Greg Ward)
        Questions about PERL <NorthernSnow@worldnet.att.net>
    Re: Questions about PERL (Steve Linberg)
    Re: Questions about PERL <dgris@moiraine.dimensional.com>
    Re: Want to output $29.85 not $29.8585 ya know? (Bart Lateur)
    Re: Want to output $29.85 not $29.8585 ya know? (Larry Rosler)
    Re: What's a script worth? (Greg Ward)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 25 Jan 1999 17:02:30 GMT
From: jambutter@my-dejanews.com
Subject: Arrays vs Hashes.
Message-Id: <78i830$rij$1@nnrp1.dejanews.com>

Can somewhene tell me when it is best recommened to use a hash as opposed to
an array, and vice versa.

Also, I'd like to know when it is necessary to use references and when it is
not necessary at all.

Thanks.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 25 Jan 1999 18:00:23 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Can you pattern match using an array?
Message-Id: <78ibfn$83g$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Bob Freedman 
<bfreedman@esdim.noaa.gov>],
who wrote in article <36AC8DC9.66C04D87@esdim.noaa.gov>:
> Can you match a pattern using an array of strings?
> 
> if (/@key/i) {....

  perldoc perlval

look for $".  Whatever is inside // behaves similar to a double-quoted
string - at least in many respects. backwacking is of course different.

Ilya


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

Date: Mon, 25 Jan 1999 18:47:24 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Difficult issues not suitable for this newsgroup?
Message-Id: <F64pJ0.su@world.std.com>

tadmc@metronet.com (Tad McClellan) writes:

>Randal L. Schwartz (merlyn@stonehenge.com) wrote:
>: Randal, Usenet Cabal member # 02134
>I guess # 90210 is already taken by a member of the
>California local of the Cabal?

If that was the case, Randal's number should be used for someone in
Boston. Or at least someone connected to the PBS kids show "Zoom".

-- 
Andrew Langmead


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

Date: Mon, 25 Jan 1999 10:13:30 -0800
From: samc@empirewest.com (Sam Curren)
Subject: Re: File Upload.
Message-Id: <MPG.1116542542a2bee39896d6@news.sonic.net>


Sure.
 Check out http://www.terminalp.com/scripts/file_upload.shtml and look at 
his example. It's a little complicated, but I used his script (with 
extensive modification) to create a totally custom solution for our 
website.

He comments his code well, and has some good technique.

-Sam

> Sam would you have a example of code you might use with the CGI.pm. I
> am interested in this topic. and would be interested in seeing some
> code to play with
> 
> Robert Saunders
> robert@iminet.com
> 
> 
> 
> 
> On Thu, 21 Jan 1999 08:57:23 -0800, samc@empirewest.com (Sam Curren)
> wrote:
> 
> >But what happens with a binary file? Now it has newlines periodicly 
> >through it.
> >
> >use CGI.pm and pull the values out that way. Much more powerful and 
> >simple to use.
> >
> >-Sam Curren
> >
> >In article <36A6ED92.7EC03B43@khayal.com>, ghulam@khayal.com says...
> >> Assuming that your file input variable is "cv" , the following should
> >> suffice :
> >> 
> >> #-------Beginning Code----------
> >> 
> >> #!/usr/bin/perl
> >> require "cgi-lib.pl";
> >> &ReadParse;
> >> open (F, ">uploaded.dat");
> >> print F "$in{'cv'}\n";
> >> close (F);
> >> 
> >> #-------End of Code-------------
> >> Note : You can name the new file  to whatever you want instead of
> >> "uploaded.dat" depending on type.e.g "wordfile.doc"
> >> 
> >> piece of cake, huh?
> >> 
> >> Alex Blyumenkrants wrote:
> >> 
> >> > Hi!
> >> >
> >> > I have the following problem:
> >> >
> >> > i need to upload a file from an Html,
> >> > if i use type="file"
> >> > what should i do to save this file in my Cgi?


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

Date: Mon, 25 Jan 1999 17:27:47 GMT
From: droby@copyright.com
Subject: Re: Getting the last number in an IP addr with a regex.
Message-Id: <78i9i7$sqi$1@nnrp1.dejanews.com>

In article <slrn7akr8s.2m0.mike@lindt.fat.dotat.at>,
  mike@fat.dotat.at (Mike Bristow) wrote:
> On 23 Jan 1999 20:35:08 +0100, Jonathan Feinberg <jdf@pobox.com> wrote:
> >mike@fat.dotat.at (Mike Bristow) writes:
> >
> >> my $octet = '0*(?:1?\d\d?|2[01234]\d|25[012345])';
> >
> >So 0000000000253 is a legal octet?
>
> Do you want it to be?  It could be, if we assume that all the octets
> are decimals.
>

But at least in Unix, it'll be interpreted as octal if actually used as part
of an IP address in, say, 'telnet 10.0.1.000253'.  Which would get you to
10.0.1.171.

This 4-octet nnn.nnn.nnn.nnn thing isn't universal by the way, as you'll note
in a previous thread on IP addresses in this group.  127.1 and 10.1.2570 are
both legitimate addresses (10.1.2570 is the same as 10.1.10.10 or if you like
octal, 012.01.012.012).  And a single rather large number is also legit.

I'm not going to try to write a truly general regex.  I don't think a regex is
the best way to deal with IP addresses.

If you're trying to separate the host part from the network part, you need
more info than is contained in the IP address anyway.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 25 Jan 1999 18:16:19 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: HELP: Compiling Perl for Dynamic Module Loading
Message-Id: <78icdj$rme$2@news0-alterdial.uu.net>

Anthony Lincoln <alincoln@netscape.com> wrote:
> I've been attempting to build 5.004_04 on a Solaris 2.6 (sun4-solaris
> architecture) machine so that dynamic loading of modules is enabled.  I
> need this because I have a module that I want to use that will be
> difficult (for me) to statically link to the perl binary.

I had no problems building 5.00502 and 5.00503-MAINT-TRIAL-3 on this
platform.  And someone here built 5.00403 a year ago with dynamic
loading, and it seems to work.  So all is not lost.  ;-)

> If I run Configure and ask for dynamic loading, I get this complaint
> midway through the script:
> 
> Checking whether your dlsym() needs a leading underscore ...
> Test program failed using dlopen.
> Perhaps you should not use dynamic loading.
[...]
> I've checked everything I can think of--library paths, makefile errors,
> compilation flags, etc, and nothing works.  I realize there's a lot of
> variables here, but if anyone's encountered a similar problem, I'd love
> to hear about it.

Hmmm.  Sounds like you've done the easy stuff.  How much do you know
about C programming?  If I were you, I'd go digging through the
'Configure' source to find the "Test program failed using dlopen"
message, dig out the test program, try to compile and link it *exactly*
as 'Configure' does, and see what happens.  You may have some shared
libraries or the dynamic loader misinstalled or hosed or something,
which Perl can't do much about.

(Note to the group at large: does Perl's Configure script log what it
does anywhere?  Is there a "really really verbose" option, to get it
tell (eg.) every command run?)

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: 25 Jan 1999 10:43:49 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Perl Criticism [summary]
Message-Id: <m3emojgsdm.fsf@moiraine.dimensional.com>

iqbal <iqbal@orangenet.co.uk> writes:

> Dont suppose anyone has a summary to this thread :-)

Sure, here you go.

topmind (drooling on himself in a small padded room):  
  Hi, I'm a total idiot.  They promise that they'll let me
  try to tie my own shoes Real Soon Now, but for now I am
  condemned to sitting in a padded room with nothing more
  lethal than a keyboard to entertain me.  Oh yeah, perl
  sucks.

CLPM regulars (gathered around a long table, throwing back
pints of Guinness):
  Perl doesn't suck.

topmind (receiving his hourly medication):
  Perl is evil.  Most of the problems on our planet are the
  result of Perl programmers.  We must stop the evil perl
  programmers before they do any more damage

CLPM regulars (looking irritated):
  Perl isn't evil.  It's a tool, and a damn fine one.

topmind (back to drooling on himself):
  But think of the managers.

CLPM regulars (back to being cocky and self-assured):
  Fuck the managers.  If they were stupid enough to become
  managers in the first place that's not our problem.

topmind (still drooling, also now twitching occasionally):
  But think of the bottom line.

CLPM regulars:
  Fuck the bottom line.  If your programmers aren't producing
  good code then you'll go out of business and the bad programmers
  will be out of their jobs.  Not our problem.

topmind (still drooling, also now grunting occasionally as
he tries to color his friend the purple dinosaur):
  Perl is unreadable.  How can you evil people use a language that
  is incomprehensible to people who haven't learned it.

CLPM regulars:
  English is also unreadable if you don't know it.

topmind (calm again after his injection):
  Perl is unreadable.

 ...(much time passes during which the last three points are repeated)...

topmind (becoming agitated again, somebody call his nurse):
  Dammit, people, I'm telling you that I'm stupid, unreliable,
  and unmaintainable.  Oops, I mean perl is stupid, or something.

CLPM regulars:
  Why don't you go implement your hypothetical language so that
  we can all see the benefits.

topmind (growing ever more agitated, his eyelids begin to twitch
ferociously as his nostrils flare):
  I'm not smart enough to understand the value of an implementation.

CLPM regulars:
  Oh, go away then.

 ...(much time passes as the previous three points are repeated)...

topmind (once again smiling as his medication takes hold):
  I can program in dozens of languages.

CLPM:
  You are lying.

topmind:
  I'm not lying.  I know Visual Basic.

CLPM:
  That's not dozens.

topmipnd (once again getting mad):
  I was exaggerating.  I can't believe you people expect me to
  mean the things I say.  That is so unfair.  Perl is unmaintainable.

CLPM:
  Go away.

 .......<snip much more>........

I'd provide the rest of the story, unfortunately this is the point at
which I started plonking everyone posting to the thread.  You'll need
to ask elsewhere to see how it ends up, although I'd be surprised if
any last minute character development took place. :-)

HTH

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 25 Jan 1999 17:51:58 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism [summary]
Message-Id: <78iavq$u0f$1@nnrp1.dejanews.com>

In article <36AC5143.5C56BD0D@orangenet.co.uk>,
  iqbal <iqbal@orangenet.co.uk> wrote:
> Hi
>
> Dont suppose anyone has a summary to this thread :-)
>
> Iqbal
>

How about:

A: Provide proof
B: We don't have to, you started it, not us.
A: Why does that make you immune from proof?
B: Why does it make YOU immune, where's your proof?
A: I have none to present, where's yours?
B: You first, you started it.
A: But there are more of you, that should give you more thinking power
    to find proof.
C: Hey B, don't listen to him. He "believes" in UFO's I think.
A: What do UFO's have to do with Perl and Programming?
C: It shows you are an idiot.
A: How so?
C: UFO's are a topic for idiots.
A: How so?  [C goes away]
continued....

-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 25 Jan 1999 19:12:54 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Perl Criticism [summary]
Message-Id: <36ACB426.D17870F5@ngb.se>

Hi!

> Dont suppose anyone has a summary to this thread :-)

Stupid troll calling himself (we have proved him male) topmind
criticises perl without knowing anything about it (this proved by
topmind not posting perl code as examples). Main point being that perl
makes you write unreadable and unmaintainable code and that it's leaky.
Though proven wrong again and again the troll keeps coming back. 

Interesting to note, though -- some interesting things have been posted,
although not by Mr. Troll.

Also, I've been polite for a long time now, but am getting very tired of
it, since the Troll avoids every posting that he realises surpassed his
understanding, rendering serious reasoning useless. Also he doesn't
understand the posts he thinks he understands, making the whole thing
even more annoying.

Most interesting is to note that most people who thought they could
avoid being dragged into this useless discussion were dragged in...

HTH
Staffan


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

Date: Mon, 25 Jan 1999 12:13:40 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl Criticism
Message-Id: <1dm6mh8.1s0ncsf12xdtq8N@roxboro0-019.dyn.interpath.net>

<topmind@technologist.com> wrote:

> "express beauty in your code?"  Exactly what is that?
> Is that a selling point in your Perl brochure?
> 
> "How will that help my bottom line?" a manager may ask.

It get's you better programmers.

You remind me of a SF novel where some guy who thought he was a great
manager wanted to put developing a totally new concept on a time table,
and when the guy who was doing the work said it couldn't be done he
wanted to fire him and move his assistant up to take over his job.

People are important.

-- 
John Moreno


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

Date: Mon, 25 Jan 1999 17:13:17 GMT
From: droby@copyright.com
Subject: Re: Perl Criticism
Message-Id: <78i8n5$s1l$1@nnrp1.dejanews.com>

In article <36AA3925.79DCD8BF@ngb.se>,
  Staffan Liljas <staffan@ngb.se> wrote:
> Uri Guttman wrote:
>
> >   t> Lump all things you hate together. Typical of humans.
>
> > and you are above being human?
>
> I can't believe I missed this one, and we spoke about Turing in this
> thread already. Stop posting everybody, topmind is someones new AI
> project. AS would maybe be a better desciption, but IMHO it's doing
> better than ELIZA. My compliments to whoever wrote the code, but you
> didn't pass the T-Test. Sorry.
>

Ah!  Must be Tushar Samant is back.  He's good at these.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 25 Jan 1999 17:43:25 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <78iafr$th6$1@nnrp1.dejanews.com>

In article <slrn7anuqc.r09.sholden@pgrad.cs.usyd.edu.au>,
  sholden@cs.usyd.edu.au wrote:
> On Mon, 25 Jan 1999 04:19:57 GMT, topmind@technologist.com wrote:
> >In article <slrn7aij5v.9ar.sholden@pgrad.cs.usyd.edu.au>,
> >  sholden@cs.usyd.edu.au wrote:
> >> On Sat, 23 Jan 1999 02:11:27 GMT, topmind@technologist.com wrote:
> >> >> It's possible to write unmaintainable code in any language.
> >> >
> >> >If I hear this flippen' MYTH stated one more time, I am going to
> >> >have Norton classify Perl as a virus.
> >>
> >> OK back that up, what language is it impossible to write unmaintainable
code
> >> in. Point me to a freely available interpreter/compiler and the language
> >> docs and I'm willing to have a crack at the impossible and write some
> >> unmaintainable code.
> >>
> >
> >
> >You are missing my point. I already had this discussion.
> >However....
>
> How am I missing the point?
>
> You say that the statement "It's possible to write unmaintainable code in
> any language" is a myth. I take that to mean that you believe it is not
> true. There a few definition of myth that I know. I assume you aren't
> talking about 'a traditional story accepted as history'. I assume you
> aren't talking about 'a story of great but unknown age'. That leaves
> (in my dictionary, your's might be bigger (mines cheap...)) 'A person
> or thing existing only in imagination, or whose actual existance is
> not verifiable'.
>
> That could mean it is not true, or that it has not been verified as true.
>
> I am offering to try to provide more evidence that the statement is true by
> showing it to be true in whatever programming language you believe to most
> show it is false.
>
> So again I ask point me to a language in which it is impossible for me to
> write unmaintainable code. Back up what you say for once.



You are making a gray issue into a black-and-white issue.
I will not fall for that fallacy. All langauges ARE abusable,
but NOT EQUALLY. Some encourage or allow more *or* different
"levels" of abuse than others.




>
> >
> >
> >> >
> >> >ALL
> >> >LANGUAGES
> >> >ARE
> >> >NOT
> >> >EQUALLY
> >> >ABUSABLE
> >> >!!!!!!!
> >>
> >> That is not what the post claimed, that is irrelevant.
> >>
> >> All that should matter is 'does the language make it hard to write
> >maintainable
> >> code'. If so then don't use the damn language for 'real' code.
> >>
> >> >I am not going to explain it again.
> >>
> >> Could you please post a reference to your first explanation... since I
> >> for one missed it (this thread is huge and I haven't attempted to read
> >> everything in it - thankfully).
> >
> >
> >It has gotten too huge for me also.
> >I don't really know of a solution
> >Other than fancy software.
>
> Just give me the reference, you must have a copy of the text somewhere, or
> at least know a few words you could enter into a dejanews search. My search
> in this thread for you posts returns way to many for me to look through them
> all - but I don't know any additional words to put in the search. I assume
> you do...
>


I either did not keep copies, or did not organize them well.
I bought some software to help me with this, but I cannot
get it to work.



> >
> >
> >> But if someone doesn't make an effort to avoid obfuscation (that's the
wrong
> >> phrase really, should be something along the lines write readable code -
the
> >> positive not negative version) then they should not be employed as a
> >> programmer.
> >>
> >
> >"Should not", yes. "Do not", no.
>
> That is not a problem for the language to solve. That is a problem
> for society to solve. If a civil engineer designs a bridge that falls down
> and kills a few hundred people, we don't demand that all civil engineers
> stop using whatever that engineer used to design said bridge. Instead we
> demand that that engineer not design any more bridges until he has shown
> that it was not his fault. If he shown his software tool resulted in the
> bridge collapse we demand engineers not to use that software product and
> recheck everything designed with said product. If it was the way the engineer
> used the product we blaim the engineer.
>
> If someone can't write code then they should not be a programmer. Pretty
> obvioud really. If they are employed as a programmer then the company
> employing them deserves to go out of business. And the other programmers
> have the right to find new jobs in a better run company.
>


But bad "hit-and-run" programmers often satisfy the requirements
as given to them. They build something that generally works,
but it is not made with maintanance in mind.

Also, I don't think the bridge analogy is applicable.
Brigdes are functionally much more simple, more
life-threatening (overall), and do not change
paradigms or expectations every
18 months.



> >Again, I am middle of the read with regard to readability
> >and maintainability. Perlers are to the far right on this.
>
> You believe a language should be made so that it is impossible to do
> unreadable things... surely that doesn't put you in the middle. My
> observation on what you believe is probably wrong, but that is how
> I've interpreted your rants...
>


I did not say "impossible", just reduced. Many programmers,
especially OOPer's, want the compiler to check everything
and build strict "walls" around structures and related data
to prevent or reduce "object abuse".

These people are much more anal about protection than I
am and have even called me "sloppy" and "loose" with
regard to programming language expectations.

However, they are equally fanatical as Perlers if not
more so. Interesting similarities and contracts
between the two camps.


> >
> >
> >
> [snip bit about making it easy to do good, instead of impossible to do bad]
> >
> >One is a "top-end" problem and one is a "bottom-end" problem.
> >I see them as relatively independant issues.
>
> The problem is that you restrict the good programmers the flexibility to
> write good code. But you obviously don't care about this.
>


I have not seen such a structure in Perl yet.


> --
> Sam
>
> You can blame it all on the internet. I do...
> 	--Larry Wall
>

-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 25 Jan 1999 12:53:09 -0500
From: James B Crigler <james.b.crigler@lmco.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Perl Criticism
Message-Id: <36ACAF85.CE3B7526@lmco.com>

[Posted and a courtesy copy mailed.]

Larry Rosler wrote responded to my message:

> For the sake of truth, every snippet posted here should be tested, even
> if it is written in a language other than Perl.

You're completely right of course.  My apologies.

But I note that tested and verified code doesn't guarantee acceptance.

> Perhaps the reason "most C programmers don't" use this locution is that
> it doesn't work (the C concept of the short-circuit operators is quite
> different from that of Perl).

Hmmm ... Since receiving Larry's courtesy email, I checked the man page
for perlop (for the 5.003 here at work) and all the current FAQs
(available online), and I found there was no mention of this difference
in the "||" operator for Perl vis-a-vis C, so I incorrectly assumed the
principle of least surprise, assumed they were the same, and was
surprised.
Mea culpa.

FWIW, is there someplace in the public documentation I should have been
able to find this difference in the operator?

> And perhaps people who don't know C shouldn't post assertions about it
> here.

Or at least not on the subject of assumed, untested arcana.  Plenty of
people here post about parts of Perl they *do* know, be they language
lawyers or not.  Though it would help if everyone only posted tested
code.
(Use of the term "language lawyer" is not meant in any deprecatory
sense whatsoever.)
-- 
Jim Crigler                 | james.b.crigler@lmco.com
Zone 0100                   | Voice: (770)494-4528
86 S. Cobb Dr.              | "There are three kinds of people:  Those
Marietta GA 30063           | who can count and those who can't."


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

Date: Mon, 25 Jan 1999 19:21:41 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Perl Criticism
Message-Id: <36ACB635.1CC0FFE0@ngb.se>

James B Crigler wrote:
> 1.  topmind is a CS grad student or professor who has a rigid,
> inflexible
>     point of view and suffers from hardening of the categories.
> 2.  topmind is Larry Wall looking for legitimate holes in the Perl.
> 3.  (less likely) topmind is Larry Wall trolling for complements on his
>     creation.

I think 1. is unlikely, since topmind doesn't seem to have a clue. For
two or three, they are amusing. But don't forget

4.  topmind is a stupid troll who doesn't care about the discussion
5.  topmind is a computor program written by a AI programmer trying to
    become immortal by creating a program that passes the Turing Test,
    and tests it on the perl community.

I think 4 and 5 are about as likely. Number 5 is my favourite, but
unfortunately, I think it's number 4 that is true.

Staffan


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

Date: 25 Jan 1999 18:10:54 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: Personal lib dir - please help
Message-Id: <78ic3e$rme$1@news0-alterdial.uu.net>

Joe Laffey <joe@laffeycomputer.com> wrote:
> I'm trying to port a series of scripts that use MLDBM (as consequently
> Storable, DB_File, and Data::Dumper) from my linux box to a Sun Ultra
> Sparc. The Sun box now has perl 5.00502 I have 5.004 on the linux box.
> 
> I need to have my own personal lib directory because the Sun box belongs
> to an ISP and I cannot install system-wide modules.
> 
> I built all of the modules using 
> %perl Makefile.PL PREFIX=/usr/home/me/mylib
> %make test
> %make install

Remember, the canonical prefix is /usr/local -- in effect you're asking
MakeMaker to put a mini-/usr/local under /usr/home/me/mylib.  (Umm, I'm
going to paraphrase that as "~/mylib".  Thus, modules will be installed
under ~/mylib/lib/perl5/site_perl/5.005, man pages will be in
~/mylib/lib/perl5/5.00502/man/man3, etc.  Take a look in the Makefile
for any of the modules that you built to see the exact ramifications of
setting PREFIX to /usr/home/me/mylib.

The long and the short of it is that you need to add *two* directories
to your search path:

   ~/mylib/lib/perl5/site_perl/5.005
   ~/mylib/lib/perl5/site_perl/5.005/sun4-solaris

because Perl's library directory separates architecture-specific files
from architecture-neutral files.  Personally, I would do this with the
PERL5LIB environment variable -- adding 'use lib' to your scripts means
that you might need to edit them again if you move to a different
system, or change how you install things on this system.

The way I normally do this is to make my home directory a
mini-/usr/local, so I can install modules like so:

   perl Makefile.PL PREFIX=~

Thus, Perl modules will go to ~/lib/perl5/site_perl/5.005, module man
pages ~/lib/perl5/5.0050x/man/man3, etc.  Then you have to put

  ~/lib/perl5/site_perl/5.005
  ~/lib/perl5/site_perl/5.005/sun4-solaris

into PERL5LIB.

> I installed DB_File first, then Data::Dumper, then Storable, and finaly
> MLDBM. This put files into different subdirs in mylib dir. I got
> sun4-solaris directories and 5.00502 dirs and 5.005 dirs and a site_perl
> dir.

Hmmm, you shouldn't have to install DB_File -- unless your ISP doesn't
have DB installed, and thus DB_File wasn't built when they built Perl.

> Only the modules that were actually installed in the directory explicitly
> named above could be found. Although perl reported that @INC includeded
> all of the subdirs. So I moved all the .pm files to the mylib dir and all
> the auto files to a mylib/auto. Now I get:
> Can't locate object method "new" via package "MLDBM::Serializer::Storable"
> at /usr/home/me/mylib/lib//MLDBM.pm line 132.
> 
> Storable is in the directory
> /usr/home/me/mylib/lib/MLDBM/Serializer/Storable.pm
> 
> I tried moving Storable's auto files into
> /usr/home/me/mylib/lib/MLDBM/Serializer/auto

But Storable *also* includes a .so file, because it's a compiled XSUB
module.  That's what gets put in the site_perl/5.005/sun4-solaris
directory, and *that* is why you shouldn't go moving files around after
you've installed them.  If you don't like how things got installed, it's
better to nuke the library tree and start over with a different prefix.
(Or set your library search path to the right thing.)

> Anyone wanna smack
> me for developing the script under linux first?

Absolutely not!  Moving Perl scripts from Linux to Solaris (or
vice-versa) is a snap.  It's a bit harder if you have to maintain a
personal Perl library on one of the machines, but as I explained above
that's not hard.

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: 25 Jan 1999 18:18:17 GMT
From: "Frank Siegel" <NorthernSnow@worldnet.att.net>
Subject: Questions about PERL
Message-Id: <78ich9$ped@bgtnsc03.worldnet.att.net>

Can anyone give me background information
about PERL scripting such as:

does it run on DIGITAL Alpha UNIX?
does it run on NT , WINDOWS 95/98?
How portable is the code between UNIX and NT, W95/98?

About how much does it cost to put on an Alpha machine?
Cost for NT?

What relationship does it have with web programming?
Is it another option for Java and/or CGI files?

Thank You so much for any insight!
Frank S.  New Hampshire






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

Date: Mon, 25 Jan 1999 13:42:27 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Questions about PERL
Message-Id: <linberg-2501991342270001@ltl1.literacy.upenn.edu>

In article <78ich9$ped@bgtnsc03.worldnet.att.net>, "Frank Siegel"
<NorthernSnow@worldnet.att.net> wrote:

> Can anyone give me background information
> about PERL scripting such as:
> 
> does it run on DIGITAL Alpha UNIX?

yes.

> does it run on NT , WINDOWS 95/98?

yes.

> How portable is the code between UNIX and NT, W95/98?

The recent ActiveState port is very good.  Perl is highly portable.

> About how much does it cost to put on an Alpha machine?

Perl is free.

> Cost for NT?

Perl is free.

> What relationship does it have with web programming?
> Is it another option for Java and/or CGI files?

It can be used for CGI programming, and is very well-suited for text
manipulation (among lots of other things).

-- 
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>


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

Date: 25 Jan 1999 11:46:15 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Questions about PERL
Message-Id: <m3aez7gphk.fsf@moiraine.dimensional.com>

"Frank Siegel" <NorthernSnow@worldnet.att.net> writes:

> does it run on DIGITAL Alpha UNIX?

Yes.

> does it run on NT , WINDOWS 95/98?

Yes.

> How portable is the code between UNIX and NT, W95/98?

Assuming you avoid Unix specific features (fork(), primarily) you'll
find perl to be amazingly portable.  The vast majority of my code runs
unchanged on several flavors of Unix as well as NT.

> About how much does it cost to put on an Alpha machine?
> Cost for NT?

Direct cost is zero in all circumstances.  Perl is completely open
source and, as such, freely modifiable and redistributable.  However,
you can incur whatever level of indirect cost (programmers,
consultants, support contracts) that you are comfortable with.

> What relationship does it have with web programming?

None directly, save being the most commonly used language for web
applications.  Perl is good at the sorts of tasks that most web apps
have to perform (slinging huge quantities of text around and handling
networking), but perl is also well suited for any systems programming
task.

Another benefit, if you are considering perl for your business, is the
relatively high availability of perl programmers.  I know that we've
had a much easier time finding qualified perl programmers than we have
qualified java programmers.  While this isn't always an issue, it is
nice to know that when you need help _now_, it will be available.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Mon, 25 Jan 1999 16:46:22 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Want to output $29.85 not $29.8585 ya know?
Message-Id: <36ae6ae7.10233626@news.skynet.be>

Bill Reid wrote:

> subject: Want to output $29.85 not $29.8585 ya know?

I'm confused here. Do you want 29.85 or 29.86? Because the latter will
be closer. You *could* really want to round to the nearest 5 cents. In
that case, just sprintf won't do. What you can do, is:

 * multiply by 20
 * add 0.5 (warning! only for positive numbers!)
 * take int() of that result
 * divide by 20 again
 * Now you can safely use sprintf('$%.2f',$number)  which returns a
string.

If you just want the nearest cent, drop everything but the sprintf
instruction.

	Bart.


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

Date: Mon, 25 Jan 1999 09:46:02 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Want to output $29.85 not $29.8585 ya know?
Message-Id: <MPG.11164db6eaf6904d9899c2@nntp.hpl.hp.com>

In article <36ae6ae7.10233626@news.skynet.be> on Mon, 25 Jan 1999 
16:46:22 GMT, Bart Lateur <bart.lateur@skynet.be> says...
 ...
>  * multiply by 20
>  * add 0.5 (warning! only for positive numbers!)
>  * take int() of that result
>  * divide by 20 again
>  * Now you can safely use sprintf('$%.2f',$number)  which returns a
> string.

The last step is a time-wasting no-op.  A number is a string is a number 
is a string is a ...

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


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

Date: 25 Jan 1999 18:30:22 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: What's a script worth?
Message-Id: <78id7u$rme$3@news0-alterdial.uu.net>

Simon Whitaker <spam@netcetera.org> wrote:
> I've been learning Perl for a while and have put it to use for various tasks
> on my website. Recently a commercial body has shown interest in a set of
> pages and scripts I have written, and is asking about buying them from me.
> Whilst the scripts themselves are fairly basic and don't do much more than
> some simple maths and presentation, it's clear that the commercial body
> involved want them and don't know how to create something similar
> themselves.

Well, the obvious answer is to charge as much as the market will bear.
The market will probably laugh in your face if you try to start at a
million quid and bargain your way down from there though.

Someone -- Tad McLellan I think -- posted a tidbit about average hourly
rates for Perl contractors recently on comp.lang.perl.misc.  Seems like
a reasonable rate would be in the US$50-75/hour range, more if you're a
wizard/guru-type who advertises your services in the back pages of the
Perl Journal.  (Hey, the gurus have to pay for their advertising!)

So, if you were in the US selling to a US company, you could multiply
the number of hours spent developing the scripts by, say $50.  (More if
you figure you're worth it.)  Not sure how consulting rates port to the
UK, but you could try s/dollars/pounds/ and see if you get away with it.

Good luck -- pricing software is a tricky job, which is probably why
most freelance programmers charge by the hour.

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

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

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