[11009] in Perl-Users-Digest
Perl-Users Digest, Issue: 4610 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 10 02:07:12 1999
Date: Sat, 9 Jan 99 23:04:37 -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 Sat, 9 Jan 1999 Volume: 8 Number: 4610
Today's topics:
Re: Perl Criticism <chatmaster@c-zone.net>
Re: Perl Criticism <chatmaster@c-zone.net>
Re: Perl Criticism dturley@pobox.com
Re: Perl Criticism dturley@pobox.com
Re: Perl Criticism <uri@home.sysarch.com>
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl Criticism <design@raincloud-studios.com>
Re: Perl Criticism <bdeitte@blue.weeg.uiowa.edu>
Re: Perl Criticism (David Formosa (aka ? the Platypus))
Re: Perl within Perl (Andre L.)
Question about 2 dimensional arrays <chad@anlon.com>
Re: Question about 2 dimensional arrays <ebohlman@netcom.com>
Re: Uploading PC files works - but not Mac files <design@raincloud-studios.com>
Re: Uploading PC files works - but not Mac files (John Moreno)
Re: Why doesn't it work? (Tad McClellan)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 09 Jan 1999 20:02:22 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Criticism
Message-Id: <3698264E.FA870851@c-zone.net>
Russ Allbery wrote:
>
> topmind <topmind@technologist.com> writes:
>
> > I challenged someone to show me why Perl's power cannot be cleaned up
> > without significant (initial) productivity loss. I have not seen any
> > yet.
>
> Perhaps because many of us believe that, like nearly all programming
> languages, Perl is as "clean" as the programmer wishes it to be. You can
> write clean Perl and you can write obfuscated Perl, things like my sig.
> My production code doesn't look anything at *all* like my signature, and
> if someone tried to do something like that in a production script, I'd
> have a long talk with them.
$^=q;@!>~|{>krw>yn{u<R<}qrwt<=x~<qj_n<}xx<v~lq<}rvn<xw<=x~{<qjwm|<:$)<s>t<
> 0
gFzD gD, 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e
0.),01,pn
n,y{rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/
#y,d,s,(\$.),$1,gee,print
:-)
>
> The same is true of most languages. The dichotomy you're presenting is
> not one that many of us agree with, so your challenge doesn't mean
> anything to us.
>
> --
> #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> $^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
> rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Sat, 09 Jan 1999 20:04:01 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Criticism
Message-Id: <369826B1.D2918594@c-zone.net>
Geez, that wrap really tweaked it.. *l*...
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1999 TRG Software and The Link Worm.
------------------------------
Date: Sun, 10 Jan 1999 04:03:27 GMT
From: dturley@pobox.com
Subject: Re: Perl Criticism
Message-Id: <7798qf$ilm$1@nnrp1.dejanews.com>
Two questions I have are, if Perl is such a terrible language, why are you
wasting time using it? Use something else if you don't like it! If you think
things could be done better, the source is freely available, why don't you fix
it to suit your tastes?
I suspect you can't.
____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 10 Jan 1999 03:59:02 GMT
From: dturley@pobox.com
Subject: Re: Perl Criticism
Message-Id: <7798i6$iad$1@nnrp1.dejanews.com>
In article <778f4a$td6$1@nnrp1.dejanews.com>,
topmind@technologist.com wrote:
>
> Hey Mr. Turkey!
>
You must still be in third grade if you resort to name calling. You have
demonstrated your maturity to the world. Can't have an intelligents discusion
without name calling, I am surprised your mommy and daddy let you use the
computer.
____________________________________
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Jan 1999 00:18:20 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Perl Criticism
Message-Id: <x7n23rk8o3.fsf@home.sysarch.com>
>>>>> "t" == topmind <topmind@technologist.com> writes:
t> No no no no! 20 LOCAL Variables. Why have a list like this:
t> local(foo, bar, smoo, smar, fart, tart, bla, bra)
t> When all you need is one keyword, "isolate". It also saves typing P-)
hey dweezlehead, how do you pass in arguments with isolate? no params
allowed if they are not local? how do you access globals with isolate?
oh, you don't allow globals! well then you will have to pass the entire
world around from sub to sub. 20 variables? that sounds too low to me.
t> Why not just use a subroutine with parameters by reference?
call by reference is a pain in the ass. have you ever worked with PL/I?
i doubt it. you have to copy everything before you can touch it. c has
call by value but you explicitly pass references. perl has call by
reference but the idiom is to do local copies immediately. both allow
you CONTROL over what is by valie and by reference.
t> Why have 10 different ways to do things. It might save
t> 30% typing, but results in programs that are 300%
t> harder to read. (Perhaps you see this as an exeration,
t> but readability (maintanability) is a HUGE cost for
t> companies.)
we have yet to see any code of your in any language. nor have we seen
any serious language designs, just a random collection of halfbaked and
borrowed ideas (which breaks one of your commandments. IMPERFECT!
IMPERFECT! NOMAD MUST STERILIZE!). come up with a real and complete
language specification, show how it handles scoping, expressions, I/O
and other fun stuff. write a compiler/interpreter for it. create the
large set of runtime code needed to support your gee-whiz
paradigms. when you are done in the 30 years it will take you, we will
look and listen.
t> It is not how fast you can crap, but how easy it is
t> to manage the result. (Yuk!)
and you are a fast crapper!
why do you claim to know perl and offer to do perl work, when you
obviously don't even know the language. have you ever written anything
in perl and have been paid for it? i would like to meet that person who
paid you so i can charge $120/hour to clean up the mess you left.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 10 Jan 1999 06:08:01 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79ggu1.cjr.dformosa@godzilla.zeta.org.au>
In article <778gcs$ufi$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <394sq15r2v.fsf@ibnets.com>,
[...]
>...when managers realize all those hit-and-run Perl hackers generated
>nothing but spehgetti code that requires a $120 per hour consultant
>to figuire out, then Perl will be tossed away, known as the
>language that made Goto's look good.
>
>@_(-->$/(.)/up/Your*$s\\|>you&%!$@#crypt=++||#@tol<>>??logists!@#
Thats not valid perl.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: 10 Jan 1999 06:16:11 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Perl Criticism
Message-Id: <779gjb$t7k@bgtnsc03.worldnet.att.net>
I don't really have anyhting to say about any of this, I just feel left
out not being part of the longest thread ever recorded in the history of
newsgroups.
Yours in Lemmingness.
Post #103
CT
------------------------------
Date: Sun, 10 Jan 1999 00:36:43 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: Perl Criticism
Message-Id: <Pine.A41.3.95.990110003553.26724A-100000@black.weeg.uiowa.edu>
On 10 Jan 1999, Charles R. Thompson wrote:
> I don't really have anyhting to say about any of this, I just feel left
Me too.
(I'm also working on my OCR.)
------------------------------
Date: 10 Jan 1999 06:47:38 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79gj87.cjr.dformosa@godzilla.zeta.org.au>
In article <778iqp$ng$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <slrn79b6bn.mcd.dformosa@godzilla.zeta.org.au>,
> dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
[...]
>However, I am suggesting getting rid of X_ altother. They'r too
>risky in the hands of idiots.
While we are at it why don't we just get rid of gloable verables? I
mean they are clearly dangourious.
[...]
>> If you are passing in 20 verables into a function then there is
>> something wrong with your design.
>
>No no no no! 20 LOCAL Variables. Why have a list like this:
>
>local(foo, bar, smoo, smar, fart, tart, bla, bra)
>
>When all you need is one keyword, "isolate". It also saves typing
> P-)
What are you tring to do? Declair 20 varibales what you wish to only
be used in your subroutine? In this case it would be better for you
to make use of my. It is normally good programing practise to delcare
your verbies before there use, indeed this is why I use strict in
anything bu the most trival programes.
[...]
>> Because he (like me) has found it to be usefull. Not just in while
>> tests (as you describe) but in if then stanemts, the map operator and
>> a number of other contexts.
>
>Show me a good real-world example.
if (my $data = m/\"\/files\/kk\/(.*)\"/) {
# do something with data
}
[...]
>> This is true, however unstated results are commen in langages that
>> permit multiple vales to be returned from a function.
>
>
>Why not just use a subroutine with parameters by reference?
Because it has a diffrent in meaning, in perticular with recursive
code for example (in lisp)
;;Given two numbers a and n, with a<n, a number a^-1 exists s.t.
;;a.a^-1=1 mod n.
(defun inverse-mod (a b)
"Find the inverse modulus of a and b"
;; As well as checking whether a and b are relatively prime, this
;; function should check whether a and b are integers.
(if (= (gcd a b) 1)
(if (< a b) ;; inverse-mod-i must have the highest parameter
;; passed first
(inverse-mod-i b a)
(inverse-mod-i a b))
(print "a and b must be relatively prime for an inverse-mod")))
(defun inverse-mod-i (a b)
"Find the inverse modulus of a and b"
(if
(= (mod a b) 1)
(values (- (truncate a b)) 1)
(multiple-value-bind
(c d)
(inverse-mod-i
b
(mod a b))
(values
(+ (* c
(- (truncate a b)))
d)
c))))
The alternative algorythum for this requires two pages of C++ partly
because of its inablity to return values like this.
>Why have 10 different ways to do things.
Because not all people think in the same mannor, diffrent people work
in diffrent ways. It is good to allow diffrent people to do things in
the way it wish to do it.
> It might save
>30% typing, but results in programs that are 300%
>harder to read.
Not realy, as perl programers are used to subs that return mulipal values.
--
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html
------------------------------
Date: Sun, 10 Jan 1999 00:42:31 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Perl within Perl
Message-Id: <alecler-1001990042310001@dialup-450.hip.cam.org>
In article <778emg$t7g$1@nnrp1.dejanews.com>, backslashxt@yahoo.com wrote:
> I have a script which displays a banner at the top of the page (rotating
> banners) and it works fine. However, in a postcard script I'm working on, I
> need to include the banner at the top of each page. But I can't seem to be
> able to make the call to the banner script work when called from the postcard
> script, it only displays the tag to the HTML file.
>
> The call I'm using:
> print "<!--\#exec cgi=\"/cgi-bin/topad.cgi\"--> \n"; (Calls banner)
>
> I've tried quite a few things here and there, and it always gets pasted as
> html code. I've done it before where the topad.cgi would be loaded even when
> called from another script but I don't remember how. Any help appreciated.
[Off-topic part]
It is not currently possible to use server-side includes in a HTML
document produced by a CGI. The server will not parse them. (This applies
to Apache, anyway.)
[Topical part]
However, there is an easy alternative.
Since the idea is to include the output of "topad.cgi", why not simply
include it directly in your script?
If "topad.cgi" is a Perl script, and assuming it is in the same directory
as your other script, replace the line,
print "<!--\#exec cgi=\"/cgi-bin/topad.cgi\"--> \n";
with
do 'topad.cgi';
print "\n";
I left out the blank space, because I don't see the point. <?>
HTH,
Andre
------------------------------
Date: Sat, 09 Jan 1999 23:36:34 -0600
From: Don Johnson <chad@anlon.com>
Subject: Question about 2 dimensional arrays
Message-Id: <36983C62.69A8F87@anlon.com>
I fairly new at perl, and I'm having some trouble figuring out this two
dimensional array stuff. All I want to do is to give a two dimensional
array some values.
For example, in a one dimensional array, you can assign values this way:
@array = (1, 2, 3, 4, 5, 6);
Is there a way to do this with a two dimensional array without using
associative arrays?
I tried this and it isn't working:
@array = ((1, 2),
(3, 4),
(5, 6));
Can anyone help me?
Thanks in advance,
Chad
------------------------------
Date: Sun, 10 Jan 1999 06:14:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Question about 2 dimensional arrays
Message-Id: <ebohlmanF5ByoE.1so@netcom.com>
Don Johnson <chad@anlon.com> wrote:
: I fairly new at perl, and I'm having some trouble figuring out this two
: dimensional array stuff. All I want to do is to give a two dimensional
: array some values.
[snip]
: I tried this and it isn't working:
: @array = ((1, 2),
: (3, 4),
: (5, 6));
You were *so* close. Remember that a two-dimensional array is really a
one-dimensional array (one element for each row) of references to other
one-dimensional arrays (each of which contains the columns for a
particular row). Also remember that you create a reference to an
anonymous array by enclosing its elements in square brackets. So all you
need to do is replace your inner parentheses with square brackets, and
you'll have an array of three references to three two-element arrays,
which is how Perl represents a 3X2 matrix. See perllol and perldsc; if
you don't understand them, see perlref and possibly perldata to get the
necessary background.
------------------------------
Date: 10 Jan 1999 04:51:31 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Uploading PC files works - but not Mac files
Message-Id: <779bkj$pme@bgtnsc03.worldnet.att.net>
>Whether or not the resource fork is necessary (or even present) depends
>upon the particular type of file being dealt with. For jpg and gif
>files, everything is in the data fork so the point is moot, if you are
>allowing the uploading of applications or other file formats that have
>information that must be maintained in the resource fork, then the
files
>need to be turned into a simple stream of bytes, macbinary is a easy
>format to create and deal with, it's 8-bit data so if that's a problem
>you'd need to use uuencode or binhex or something, but unless you are
>sending the files by mail that's probably not really a problem.
That's helpful to know about the GIF JPG situation. You totally lost me
after that, but at least I have enough to know I need to study some
more. :)
Thanks. CT
------------------------------
Date: Sun, 10 Jan 1999 00:58:05 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Uploading PC files works - but not Mac files
Message-Id: <1dle57e.1yij1wk4nhbrwN@roxboro0-050.dyn.interpath.net>
Charles R. Thompson <design@raincloud-studios.com> wrote:
> >Whether or not the resource fork is necessary (or even present) depends
> >upon the particular type of file being dealt with. For jpg and gif
> >files, everything is in the data fork so the point is moot, if you are
> >allowing the uploading of applications or other file formats that have
> >information that must be maintained in the resource fork, then the files
> >need to be turned into a simple stream of bytes, macbinary is a easy
> >format to create and deal with, it's 8-bit data so if that's a problem
> >you'd need to use uuencode or binhex or something, but unless you are
> >sending the files by mail that's probably not really a problem.
>
> That's helpful to know about the GIF JPG situation. You totally lost me
> after that, but at least I have enough to know I need to study some
> more. :)
Well this isn't the group to go into more details, if you'd like more
you could mail me (or ask in comp.sys.mac.programmer.misc).
--
John Moreno
------------------------------
Date: Sat, 9 Jan 1999 21:49:37 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Why doesn't it work?
Message-Id: <h08977.ka2.ln@magna.metronet.com>
Martin Harrigan (harrigan@mailexcite.com) wrote:
: I'm trying to write a perl script to redirect a user to a page based on the
: argument after the ?. Can anyone tell me where I'm going wrong?
: #!/usr/local/bin/perl
: $url = param('url');
Where is the definition for the param() function?
Didn't you get a compilation error message about that?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 4610
**************************************