[14007] in Perl-Users-Digest
Perl-Users Digest, Issue: 1417 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 18 18:09:34 1999
Date: Thu, 18 Nov 1999 15:05:52 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942966351-v9-i1417@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 18 Nov 1999 Volume: 9 Number: 1417
Today's topics:
"The Art of Perl" (was Re: Perl programming sytle) <jeffp@crusoe.net>
Re: /o in regexp with mod_perl <moseley@best.com>
Re: /o in regexp with mod_perl (Kragen Sitaker)
5.005_03 v/s 5.004_03 <ylegrice@us.oracle.com>
ActivePerl install problem fix <jarobert@tivoli.com>
Re: Adding to @INC during perl install (Martien Verbruggen)
Re: Adding to @INC during perl install (M.J.T. Guy)
adjusting HTML <sackj@rpi.edu>
Re: adjusting HTML <sackj@rpi.edu>
Re: adjusting HTML <rootbeer@redcat.com>
Re: adjusting HTML <gellyfish@gellyfish.com>
Re: another Net::LDAP problem (Kenneth Graves)
Apache::Registry issue <webmaster@webdream.com>
Re: Apache::Registry issue <moseley@best.com>
Re: Apache::Registry issue (Jon Drukman)
building perl with -Dbool=char <Henry.Liao@trw.com>
C prog requiring i/p from STDIN called from perl! <dsrinu@acsu.buffalo.edu>
Re: Call for Programs: the "phonecode" benchmark (Anno Siegel)
Re: Call for Programs: the "phonecode" benchmark <lr@hpl.hp.com>
Re: Call for Programs: the "phonecode" benchmark <lr@hpl.hp.com>
Re: Call for Programs: the "phonecode" benchmark (Anno Siegel)
Re: Call for Programs: the "phonecode" benchmark <uri@sysarch.com>
Re: Can open file with Telnet but not browser <amonotod@netscape.net>
Re: Can open file with Telnet but not browser <amonotod@netscape.net>
Re: Can open file with Telnet but not browser <lr@hpl.hp.com>
Re: Can open file with Telnet but not browser <flavell@mail.cern.ch>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Nov 1999 12:13:25 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: "The Art of Perl" (was Re: Perl programming sytle)
Message-Id: <Pine.GSO.4.10.9911181209270.24181-100000@crusoe.crusoe.net>
[posted & mailed]
> I was recently "chastised" by someone for programming perl on WinNT
> like I program C on UNIX. He insisted that I should programm more
> "perl-like" and many of the constructs he suggested as changes were
> definately not C-like, and were definately harder to read. (IMO)
Well, PINCACINP. (Perl is not C, and C is not Perl.)
> In addition, writing it C-like makes it easier for non-Perl programmers
> to understand it.
Um, it makes it easier for C programmers to read it, I'd guess. But are
you saying there's something inherently unreadable about Perl, and
something inherently readable about C?
> Now I know I am free to write my programs. However, I would like to hear
> other people's thoughts on perl programming style.
If you would wait a year and a half to two years, you will probably find a
book on the market entitled "The Art of Perl"... you might want to peruse
it. While it is not yet existent, here is its current development stage:
http://pinsir-18.dynamic.rpi.edu/book/contents.html
It talks (and will talk) about how to write Perl as Perl, and how to write
it as efficient Perl, and sometimes how to write it in an idiomatic and
unreadable way. :)
--
MIDN 4/C PINYAN, USNR, NROTCURPI http://www.pobox.com/~japhy/
jeff pinyan: japhy@pobox.com perl stuff: japhy+perl@pobox.com
"The Art of Perl" http://www.pobox.com/~japhy/book/
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
------------------------------
Date: Thu, 18 Nov 1999 12:21:20 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: /o in regexp with mod_perl
Message-Id: <MPG.129dff97fb5a246c98988e@nntp1.ba.best.com>
lee.lindley@bigfoot.com (lee.lindley@bigfoot.com) seems to say...
> $re = qr{($_)}; # Compiled each time this line is executed
> for ("this is another fine mess", "that is some other guy") {
> print "true for $1\n" if /$re/; # NEVER COMPILED HERE !!!!!
> # It was compiled when the assignment was made!
Ok, Ok. I think I see that now. use re 'debug' does show that I don't
need /o when qr// has be used.
Here's my confusion:
sub match_it {
my ( $text, $match_re ) = @_;
foreach ( split m[\s+], $text ) {
print "Matched: $_\n" if /$match_re/;
}
}
So, looking at the above I would normally think I should say
print "Matched: $_\n" if /$match_re/o;
since it's using that expression over and over.
but since $match_re was created with qr// then it's already compiled.
Of course, match_it() doesn't know that $match_re was generated from
qr// or if it is just a quoted string. That's where I was confused.
Thanks,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 18 Nov 1999 22:29:17 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: /o in regexp with mod_perl
Message-Id: <15%Y3.26120$YI2.1172242@typ11.nn.bcandid.com>
In article <MPG.129dff97fb5a246c98988e@nntp1.ba.best.com>,
Bill Moseley <moseley@best.com> wrote:
>Of course, match_it() doesn't know that $match_re was generated from
>qr// or if it is just a quoted string.
No, but m// does.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 18 Nov 1999 15:59:10 -0800
From: ylegrice <ylegrice@us.oracle.com>
Subject: 5.005_03 v/s 5.004_03
Message-Id: <383492CE.D901E996@us.oracle.com>
I have a perl script that I use to "compile" text files into scripts on
a sun system. We recently installed 5.005_03 on a new server, and now I
get the following error when I try to run my "compiler" on multiple
files:
String found where operator expected at (eval 2056) line 1, near "% =
''"
(Missing operator before ''?)
Actually, I get one of these messages for each file passed to the
script. However, when I try to find a line inside my script that
matches the "% = ....", I can't find it.
This error does not occur if I pass just one file to the "compiler".
And the compiler is still working fine on my other servers running
5.004_03.
I read through the changes made to 5.005, but nothing really sounds like
it should cause this type of change. Am I missing something obvious?
Thanks for any help!
------------------------------
Date: Thu, 18 Nov 1999 10:51:30 -0600
From: Jack Robertson <jarobert@tivoli.com>
Subject: ActivePerl install problem fix
Message-Id: <38342E92.947A30F@tivoli.com>
Several postings have mentioned ActivePerl install problems
that yield a "Could not create Perl interpreter" message.
None of the suggested solutions, including the one in the
ActiveState release notes, worked for me.
A fix that did work: Remove all of the existing 'perl.exe'
from the environment path before installing.
--
Jack B. Robertson Tivoli Systems, Inc.
jarobert@tivoli.com 9442 Capitol of Texas Hwy.
(512)436-1253 Austin, TX 78759
------------------------------
Date: 18 Nov 1999 12:03:02 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Adding to @INC during perl install
Message-Id: <slrn837qol.1qp.mgjv@wobbie.heliotrope.home>
On 18 Nov 1999 02:21:33 GMT,
Greg Boug <gboug@iona.kau1.kodak.com> wrote:
> On Tue, 16 Nov 1999 10:30:24 -0500, Tony Demark <tpost@intelihealth.com> wrote:
> >This would seem to be an easy question, but I just can't find the answer
> >in the FAQ or INSTALL file:
> >
> >When installing perl (5.005_03), how do I add additional directories to
> >@INC?
>
> What you may want is something like this:
>
> #!/usr/bin/env perl -w
> BEGIN {
> # Modify @INC to suit your needs here
> }
>
> # Program begins here...
>
> This modifies the @INC before compile time...
at, not before.
and that is what the lib pragma is for:
use lib 'foo/bar/banana';
unless you need to do something terribly complex in that block.
But, I think he rather was asking for a way to change the system wide
configuration of his perl instalation. The above two solutions will only
work for a single script.
Martien
--
Martien Verbruggen |
Interactive Media Division | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 18 Nov 1999 16:16:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Adding to @INC during perl install
Message-Id: <8118on$o7u$1@pegasus.csx.cam.ac.uk>
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>
>It might be possible to edit config.sh (after running Configure etc) and
>alter the variable installsitelib and then run Configure -S to propagate
>the change ... Does any *know* whether this would work for multiple
>values in installsitelib - its a bit late to start messing with this
>right now . Actually I'm certain this has come up before but I cant
>remember what the answer was.
Not a hope. The variables installsitelib and co are used to
construct filenames for installation, like
$Config{installsitelib}/Some/Module.pm
So the variable has to be a valid path, not a list of paths.
Mike Guy
------------------------------
Date: Wed, 17 Nov 1999 10:56:34 -0500
From: Jeff Sack <sackj@rpi.edu>
Subject: adjusting HTML
Message-Id: <3832D031.6F75C674@rpi.edu>
A quick question:
Any suggestions on how to insert/remove words from a specified section
of an HTML document? For instance, if I wanted to insert three words
into the <H3> ... </H3> section or delete two words from the <BODY> ...
</BODY>? Preferably the word to be removed would be chosen randomly,
but it can not be a member of a certain list called @words_to_keep (or
something like that). Likewise, the word to be inserted should be
inserted at a random location. I have to be careful to make sure that
these insertions/deletions do occur inside and do not alter any of the
tags that are inside these sections ( like inside this <FONT (...)> ).
Any suggestions? I have a seemingly crude solution to this, but it does
not seem reliable. I am sure that there is a fairly simple solution to
this... Any help would be GREATLY appreciated. Thanks in advance...
Jeff
------------------------------
Date: Wed, 17 Nov 1999 15:28:22 -0500
From: Jeff Sack <sackj@rpi.edu>
Subject: Re: adjusting HTML
Message-Id: <38330FE6.8E04A5F0@rpi.edu>
>
> Use HTML::Parser - I have posted a number of examples in the last few
> weeks.
I checked through the examples and also through the documentation. I'm not
sure that HTML::Parser is exactly what I want. Suppose I have a scalar
$html that contains the entire HTML file. I want the scalar back exactly
the way it was (carriage returns and all) plus or minus a few words inside
certain tags. It seems that with the HTML::Parse module, I have to define
callbacks that will reconstruct the original HTML and make the desired
modifications as the parsing is done. Other possible solutions seem to
involve reconstructing the original HTML based on complex data structures
(like HTML::TreeBuilder). Since one of my concerns is making as few changes
as possible to the original file, reconstructing it is not an attractive
option.
I guess what I want is something that will reliably give me exactly what's
inside the <H1> tags for example. I want to be able to modify that and have
it placed back in the scalar $html. Is there something that will give me a
reference to a substring so that I can modify the substring and the larger
string will also be affected? I hope this question makes sense.
Thanks for taking the time to help me out...
------------------------------
Date: Thu, 18 Nov 1999 13:36:57 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: adjusting HTML
Message-Id: <Pine.GSO.4.10.9911181331450.16575-100000@user2.teleport.com>
On Wed, 17 Nov 1999, Jeff Sack wrote:
> I checked through the examples and also through the documentation. I'm not
> sure that HTML::Parser is exactly what I want.
> I guess what I want is something that will reliably give me exactly what's
> inside the <H1> tags for example.
Maybe you'll have to replace HTML::Parser with another module (perhaps of
your own making) to do this.
> Is there something that will give me a reference to a substring so
> that I can modify the substring and the larger string will also be
> affected?
Yes and no. If you know where the substring is in the larger string, you
can do a substitution on just that substring.
substr($fred, 100, 30) =~ s/hello/good-bye/g;
But I don't think that will help much with what you're trying to do.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 18 Nov 1999 16:15:37 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: adjusting HTML
Message-Id: <38342629_1@newsread3.dircon.co.uk>
Jeff Sack <sackj@rpi.edu> wrote:
>
> Any suggestions on how to insert/remove words from a specified section
> of an HTML document?
>
Use HTML::Parser - I have posted a number of examples in the last few
weeks.
/J\
--
"It's easier for a man to enter a camel is he stands on a box" -
Jonathan Creek
------------------------------
Date: Thu, 18 Nov 1999 20:27:17 GMT
From: kag@kag.citysource.com (Kenneth Graves)
Subject: Re: another Net::LDAP problem
Message-Id: <slrn838o2l.eo.kag@kag.citysource.com>
In article <38311094.E71042BB@gmx.de>, Michael Scheferhoff wrote:
>$conn = new Mozilla::LDAP::Conn("erra", "389", $user, $pass);
>die "Could't connect to LDAP server ERRA" unless $conn;
>
>Me not being a ldap specialist I have some problems with the $user
>variable. In the manual is written that this should be the "bind DN". I
>take the normal user name. Is this wrong?
Yes. You want to use the "distinguished name" of the object you want
to bind as. The exact form of the DN will depend on how you configured
your LDAP server. Some typical schemes:
uid=kag, ou=people, o=citysource.com
cn=Kenneth Graves, o=CitySource, c=US
uid=kag, ou=accounts, dc=citysource, dc=com
(ou is organizational unit, cn is common name, dc is domain component,
o is organization. It's all inherited from X.500. RFC 2256 seems to
list most of them.)
Note that your code is using Mozilla::LDAP and your subject refers to
Net::LDAP. They are different modules that do similar things. Make
sure you aren't using documentation for the wrong one.
--kag
------------------------------
Date: Thu, 18 Nov 1999 16:45:26 GMT
From: "Craig Vincent" <webmaster@webdream.com>
Subject: Apache::Registry issue
Message-Id: <G2WY3.83$z43.374@198.235.216.4>
I've come across something awfully peculiar (at least in my eyes).
Using Linux RH6.1 -> mod_perl/Apache::Registry (latest ver.)
I have a simple mailing script with basic error checking (ie. Making sure
fields are valid and values entered).
Here's my issue...
Say for example I filled out the following fields
<snip>
Name: Craig Vincent
Country: none
Zip: asdfas
</snip>
Now my script obviously would scream at me that the zip code is invalid.
That works fine...However, should I reload the page (repost my initial
submission)..this is the result:
<snip>
Name: ,
Country: none,none,none
Zip: ,,asdfas
</snip>
I just embedded Apache::Registry today so I'm almost positive that's the
culprit behind this bizarre behavior. Does anyone have any ideas on why
this is happening and better yet...how to resolve this problem?
--
Sincerely,
Craig Vincent
Senior Webmaster/Programmer
Web Dream Inc.
------------------------------
Date: Thu, 18 Nov 1999 09:34:28 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: Apache::Registry issue
Message-Id: <MPG.129dd87c1d450df898988c@nntp1.ba.best.com>
Craig Vincent (webmaster@webdream.com) seems to say...
> I've come across something awfully peculiar (at least in my eyes).
In my eyes, too. You posted to a perl group without posting any perl
code that you may think isn't working correctly.
> I just embedded Apache::Registry today so I'm almost positive that's the
> culprit behind this bizarre behavior. Does anyone have any ideas on why
> this is happening and better yet...how to resolve this problem?
Are you saying this is running under mod_perl/ Apache::Registry? Did
you run the server with -X for testing?
There's good resources at http://perl.apache.org
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 18 Nov 1999 22:48:32 GMT
From: jsd@gamespot.com (Jon Drukman)
Subject: Re: Apache::Registry issue
Message-Id: <slrn8390gm.3vvcdjn.jsd@edit-q.gamespot.com>
On Thu, 18 Nov 1999 16:45:26 GMT, Craig Vincent <webmaster@webdream.com> wrote:
>I've come across something awfully peculiar (at least in my eyes).
>
>Using Linux RH6.1 -> mod_perl/Apache::Registry (latest ver.)
for modperl questions,
you'll have better luck on the modperl mailing list
than on this newsgroup.
>Now my script obviously would scream at me that the zip code is invalid.
>That works fine...However, should I reload the page (repost my initial
>submission)..this is the result:
>
><snip>
>Name: ,
>Country: none,none,none
>Zip: ,,asdfas
></snip>
almost certainly you are getting bit by modperl's persistence of
variables. you should be using the most recent version of the
CGI.pm module first of all.
secondly, use my variables *everywhere*. third, if in doubt about
the scope of a variable, triple check it, because it's probably
persisting between invocations. remember, modperl keeps your script
in suspended animation between calls. all the variables have their
previous values, so if you don't localize them somehow, they will
keep coming back to haunt you. also don't ever do this:
my $x;
do stuff with $x here
sub foo {
refer to $x here
}
this will trigger the "Variable $x won't stay shared" warning. always
pass $x explicitly into your subroutines, ie:
my $x
foo($X);
sub foo {
my $x=shift;
...blah...
}
-jsd-
------------------------------
Date: Thu, 18 Nov 1999 22:11:55 +0000
From: Henry Liao <Henry.Liao@trw.com>
Subject: building perl with -Dbool=char
Message-Id: <383479AB.52DD036E@trw.com>
Hello,
I'm having trouble using perl on Linux because it is configured to
define bool=char. Perl on Solaris and Irix doesn't require such a
definition and seem to work fine, but I couldn't compile it on Linux
without defining bool. Does anyone know why?
I'm asking because I link perl into my C++ program, and the redefinition
of bool is conflicting with C++'s own bool type. I don't have this
difficulty with Solaris and Irix, but the same program won't work on
Linux. All three platforms are using perl 5.005_03. Solaris and Irix
versions were compiled using gcc 2.8.1, and on Linux (Mandrake 6.0) it's
using pgcc-2.91.66.
Any help would be greatly appreciated.
--Henry
------------------------------
Date: Thu, 18 Nov 1999 15:02:50 -0500
From: Srinivas Dangeti <dsrinu@acsu.buffalo.edu>
To: Srinivas Dangeti <dsrinu@acsu.buffalo.edu>
Subject: C prog requiring i/p from STDIN called from perl!
Message-Id: <Pine.GSO.4.05.9911181459350.19313-100000@ming.eng.buffalo.edu>
Hi,
I wanted to invoke an executable from perl program. And that executable
prompts the user for input. Is there any way to specify the inputs in the
perl program itself.
e.g.,
read_n_print.exe is an executable which prompts for a number from STDIN
and prints it to STDOUT.
system("read_n_print.exe");
But this call waits on the user to give the input.
How do I go about solving this problem?
Your response will be appreciated.
Thanks
Srinivas Dangeti (dsrinu@eng.buffalo.edu)
------------------------------
Date: 18 Nov 1999 13:43:11 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Call for Programs: the "phonecode" benchmark
Message-Id: <810vpf$4h0$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <80ua7t$mar$1@news.rz.uni-karlsruhe.de> on 17 Nov 1999
>13:23:09 GMT, Lutz Prechelt <prechelt@ira.uka.de> says...
>> - Out of the following set of scripting languages:
>> Perl, Python, Rexx, Tcl
>
>How odd. I just wrote this in another thread five minutes ago, so I'll
>cut and paster it out of my outbox.
>
>Perl is a programming language, and things written using Perl are Perl
>programs. Some languages have 'script' in their names, and you can call
>things written using them scripts; but Perl isn't one of them.
>
>> o How do the scripting languages compare to standard programming
>> languages such as C or Java?
>
>What is there about Perl that distinguishes it from 'standard
>programming languages such as C or Java'?
The lack of an explicit compilation step. I have never seen the
term "scripting language" as pejorative, merely as something like
a synonym to "interpreted language". If someone wants to call
Perl a scripting language, that's fine with me.
Speaking of coincidence, though... The problem that Lutz wants
coded in various languages (note lack of qualifier to accommodate
sensibilities) is exactly what Randal published in *mumble* about
a month ago: Finding words from a dictionary that correspond to
a given phone number. He may want to comment himself.
Anno
------------------------------
Date: Thu, 18 Nov 1999 13:13:34 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Call for Programs: the "phonecode" benchmark
Message-Id: <MPG.129e0bdc496e402698a231@nntp.hpl.hp.com>
In article <x7bt8rsod6.fsf@home.sysarch.com> on 18 Nov 1999 12:25:57 -
0500, Uri Guttman <uri@sysarch.com> says...
> >>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
> AS> There may be my (German) linguistic background at work here. Like
> AS> many computer-related terms, German has borrowed "Skript" from
> AS> English, but none of the pejorative associations which seem to
> AS> taint the English term. It simply means "program written in an
> AS> interpreted language".
>
> that is still perjorative in my book. how the language executes is
> irrelevent to the ability of the language to do a job. it may be
> relevent to the execution speed, memory use, need for a runtime system,
> etc. but it is not useful when comparing languages themselves.
Agreed. The term 'scripting language' carries implications of
simplicity relative to a 'programming language'. Hence requiring fewer
skills from the user. Hence 'script-kiddies' and such.
> AS> I know next to nothing about Java, but was given to understand
> AS> it is a compiled language in the sense that it produces native
> AS> machine code. Have I misunderstood?
>
> java typically compiles down to a jvm (java virtual machine) just like
> many pascal "compilers" generated pcode which was then interpreted.
Most Java implementations produce 'byte-code', which is then interpreted
by the JVM. Some implementations do Just-In-Time (JIT) compilation of
the byte-code into native machine code. But AFAIK this all is handled
each time the program is executed; there are no compiled object code
files, as for C, etc.
Perl, Java and C form a continuum of interpreted vs compiled languages.
Each of them is a programming language, not a scripting language. Shell
languages are scripting languages. I don't know what Javascript and
VBscript and all are. Someone said here recently that Perlscript is
Perl for M$-ASP, in which case it is a programming language also.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 18 Nov 1999 08:12:51 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Call for Programs: the "phonecode" benchmark
Message-Id: <MPG.129dc55a9f059eb998a22e@nntp.hpl.hp.com>
In article <810vpf$4h0$1@lublin.zrz.tu-berlin.de> on 18 Nov 1999
13:43:11 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
> Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
> >In article <80ua7t$mar$1@news.rz.uni-karlsruhe.de> on 17 Nov 1999
> >13:23:09 GMT, Lutz Prechelt <prechelt@ira.uka.de> says...
...
> >> o How do the scripting languages compare to standard programming
> >> languages such as C or Java?
> >
> >What is there about Perl that distinguishes it from 'standard
> >programming languages such as C or Java'?
>
> The lack of an explicit compilation step. I have never seen the
> term "scripting language" as pejorative, merely as something like
> a synonym to "interpreted language". If someone wants to call
> Perl a scripting language, that's fine with me.
It's not fine with me, because the common interpretation of 'scripting'
*is* pejorative compared to 'programming'; this extends to the
practitioners also.
Does Java have 'an explicit compilation step'? If so, what are all the
JIT compilers about? If not, why is Java a 'standard programming
language' and not 'a scripting language'?
This has the stink of discrimination, to me.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 18 Nov 1999 16:41:16 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Call for Programs: the "phonecode" benchmark
Message-Id: <811a7c$4nv$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <810vpf$4h0$1@lublin.zrz.tu-berlin.de> on 18 Nov 1999
>13:43:11 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
>> Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>> >In article <80ua7t$mar$1@news.rz.uni-karlsruhe.de> on 17 Nov 1999
>> >13:23:09 GMT, Lutz Prechelt <prechelt@ira.uka.de> says...
>
>...
>
>> >> o How do the scripting languages compare to standard programming
>> >> languages such as C or Java?
>> >
>> >What is there about Perl that distinguishes it from 'standard
>> >programming languages such as C or Java'?
>>
>> The lack of an explicit compilation step. I have never seen the
>> term "scripting language" as pejorative, merely as something like
>> a synonym to "interpreted language". If someone wants to call
>> Perl a scripting language, that's fine with me.
>
>It's not fine with me, because the common interpretation of 'scripting'
>*is* pejorative compared to 'programming'; this extends to the
>practitioners also.
There may be my (German) linguistic background at work here. Like
many computer-related terms, German has borrowed "Skript" from
English, but none of the pejorative associations which seem to
taint the English term. It simply means "program written in an
interpreted language".
>Does Java have 'an explicit compilation step'? If so, what are all the
>JIT compilers about? If not, why is Java a 'standard programming
>language' and not 'a scripting language'?
I know next to nothing about Java, but was given to understand
it is a compiled language in the sense that it produces native
machine code. Have I misunderstood?
>This has the stink of discrimination, to me.
Well, if the opposite is 'standard language' that certainly makes sense.
Anno
------------------------------
Date: 18 Nov 1999 12:25:57 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Call for Programs: the "phonecode" benchmark
Message-Id: <x7bt8rsod6.fsf@home.sysarch.com>
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> There may be my (German) linguistic background at work here. Like
AS> many computer-related terms, German has borrowed "Skript" from
AS> English, but none of the pejorative associations which seem to
AS> taint the English term. It simply means "program written in an
AS> interpreted language".
that is still perjorative in my book. how the language executes is
irrelevent to the ability of the language to do a job. it may be
relevent to the execution speed, memory use, need for a runtime system,
etc. but it is not useful when comparing languages themselves.
AS> I know next to nothing about Java, but was given to understand
AS> it is a compiled language in the sense that it produces native
AS> machine code. Have I misunderstood?
java typically compiles down to a jvm (java virtual machine) just like
many pascal "compilers" generated pcode which was then interpreted.
>> This has the stink of discrimination, to me.
AS> Well, if the opposite is 'standard language' that certainly makes sense.
agreed. i saw one solution to this posted on FWP but i am not interested
in hacking on the problem. it won't solve anything nor really help the
original poster with her decision. sounds like a class project too.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Thu, 18 Nov 1999 12:41:10 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <810s56$kb3$1@nnrp1.deja.com>
pacman@defiant.cqc.com (Alan Curry) wrote:
> First of all, it's an HTTP header, not a part of the HTML.
Well, 30 posts later, someone declares what the argument is...
> Second, just because you're using CGI doesn't mean you have to output
> HTML.
> If you'd rather just output normal text, you can. That was the point.
And then defends the argument, with a viable point. Great job, now I
understand, thank you.
> Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" --
> Cartman
Yeah, what Cartman said.
So, did you go back to the start of the thread, and try the code that I
posted? If so, what did you get for a result? If I could get an answer
from someone on that, I'd probably drop the thread. Even though it has
been a learning experience.
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 18 Nov 1999 12:53:28 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <810ss7$kv9$1@nnrp1.deja.com>
"Amy D. Moore" <amoore@thebigstuff.com> wrote:
> sub get_data {
> open(GUIDE, '< storeloc.txt') or die "Can't open store.txt.\n";
> ## End get_data
> }
> When I run the script in Telnet, it prints out all the HTML just fine.
> When I run it in a browser, "Can't open store.txt" shows up in the
> error
> message. This has me completely befuddled.
>
> Location of script: http://www.triumphglass.com/locations/default.cgi
> The storeloc.txt file is in the same directory.
>
Let's give this another whirl...
Perhaps your working directory is set to something other than your
cgi-bin directory. You can test this with the following code:
#!perl -w
# working_dir.pl
# amonotod
# Use to find the working directory
# on your webserver.
use Strict;
use Cwd;
my $dir=Cwd::cwd;
print "Content-type: text/plain\n\n";
print "The current dir is $dir\n";
exit;
Good luck,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 18 Nov 1999 07:11:41 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <MPG.129db7007439aac998a22d@nntp.hpl.hp.com>
In article <810ss7$kv9$1@nnrp1.deja.com> on Thu, 18 Nov 1999 12:53:28
GMT, amonotod <amonotod@netscape.net> says...
...
> Perhaps your working directory is set to something other than your
> cgi-bin directory. You can test this with the following code:
>
> #!perl -w
> # working_dir.pl
> # amonotod
> # Use to find the working directory
> # on your webserver.
>
> use Strict;
use strict;
Though some file systems are case-insensitive, the importing mechanisms
aren't.
> use Cwd;
>
> my $dir=Cwd::cwd;
OK; just
my $dir = cwd;
will do, because the function name is exported by the module.
> print "Content-type: text/plain\n\n";
> print "The current dir is $dir\n";
He's got it!
Another observation: I've unfailingly been able to locate the cgi-bin
directory via this snippet:
my ($cgi_dir) = $0 =~ m!(.+)[/\\]!;
As has been noted many times, this does *not* have to be the current
directory when the CGI program is launched.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 18 Nov 1999 16:54:53 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Can open file with Telnet but not browser
Message-Id: <Pine.HPP.3.95a.991118165157.19393D-100000@hpplus01.cern.ch>
On Thu, 18 Nov 1999, amonotod wrote:
> > >> > print "Content-type: text/html\n\n";
> > >> > print "The current dir is $dir\n";
> That line contains what I was taught as the proper beginning to an HTML
> file, _any_ HTML file.
What you have provided is not an HTML file. It would fail syntax
validation under any of the open published HTML DTDs. text/plain would
have been fine.
> Always start with "Content type: text/html"
> with two new lines following it. Have you any objections to that?
Yes.
> yeah, and the answer is no, it's not HTML. It's Perl code, even as
> sloppy as I was...
You're asking to be plonked. Fine by me.
--
* Progress (n.): The process through which Usenet has evolved from
smart people in front of dumb terminals to dumb people in front of
smart terminals. -- obs@burnout.demon.co.uk
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 1417
**************************************