[12977] in Perl-Users-Digest
Perl-Users Digest, Issue: 387 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 16:17:38 1999
Date: Thu, 5 Aug 1999 13:10:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 5 Aug 1999 Volume: 9 Number: 387
Today's topics:
Re: My Last Words on => vs comma (Greg Bacon)
Re: My Last Words on => vs comma (Larry Rosler)
Re: My Last Words on => vs comma <tchrist@mox.perl.com>
Re: My Last Words on => vs comma (Matthew Bafford)
Re: My Last Words on => vs comma <rra@stanford.edu>
Re: Nastiness contrary to the spirit of perl? <jcreed@cyclone.jprc.com>
Re: Nastiness contrary to the spirit of perl? <mhc@Eng.Sun.COM>
Perl is Not Opening a file craig_davids@my-deja.com
Re: Perl is Not Opening a file <makarand_kulkarni@my-deja.com>
Re: Perl is Not Opening a file <rootbeer@redcat.com>
Reading a file into array PERL NEWBIE (Eric Jensen)
Re: Reading a file into array PERL NEWBIE <rootbeer@redcat.com>
split array with \n? <tom.kralidis@ccrs.nrcanDOTgc.ca>
Re: split array with \n? <rra@stanford.edu>
Re: truncation without rounding <revjack@radix.net>
Re: Turning off cashing from Perl??? <flavell@mail.cern.ch>
Re: Why no Perl books at Fry's? <a794636757612661@mailcity.com>
Windows NT + Perl <flash_fire@email.msn.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Aug 1999 18:36:42 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: My Last Words on => vs comma
Message-Id: <7ocljq$a2f$1@info2.uah.edu>
In article <19990805172653.47299.qmail@hotmail.com>,
"Perl King" <perlking@hotmail.com> writes:
: The point of my last post was to show that you can NOT use the
: corresponds-to operator everywhere you use the comma operator.
: In the case of the open example
:
: open PW => '/etc/passwd';
:
: it causes a syntax error.
If it hurts to do that, then don't do that!
: It may cause unexpected errors in other code.
You're FUDding. Give examples or hush.
: In short, I see no reason to use "=>" instead of ",".
Good. Don't do it. No one is forcing you to. Different programmers
have different styles. Some are better than others, but there is no
absolute best style (except mine, of course :-).
: The comment that "it looks better" just doesn't wash.
Why not? Are you an engineer or something? Programming is art, you
know. Aesthetics is valuable in art.
: A comma is used in virtually all programming languages to separate
: arguments and is easily recognized by programmers.
Some languages use whitespace for it. Some even intuit structure
from whitespace. What's your point?
: The => can be confused with a structure pointer or branch operator.
Down that path lies madness. Java uses the + operator for string
concatenation. Should we not use + for other purposes?
: "=>" also requires extra keystrokes,
Good style, applied consistently and ruthlessly, usually does. So
what? It's worth the extra effort.
: and may be less efficient.
Is it or isn't it? Quit pussyfooting around and dispense with the
FUD.
: I have not see it used anywhere in Perl books or standard code except
: for hash initialization.
All my Perl books are out on loan. Tom, does PCB use => in other
contexts? There may be books on the way that do it. What's your
point?
: Using "=>" instead of "," just because you CAN makes me think of
: someone who prefixes numeric constants with "+" since "it makes them
: stand out more".
People who complain about => versus , remind me of people who complain
for the sake of complaining.
: My advice? Use the language as it was meant to be used, and don't
: try to decorate it!
Now *there's* a bold statement. First, please demonstrate how you are
qualified to declare how Perl was meant to be used. After you've done
that, please tell us precisely how Perl was meant to be used.
: Perl is already beautiful enough as is.
I will agree with you that Perl is beautiful.
Greg
--
Must one first batter their ears, that they may learn to hear with
their eyes? Must one clatter like kettledrums and penitential
preachers? Or do they only believe the stammerer?
-- Nietzsche
------------------------------
Date: Thu, 5 Aug 1999 11:41:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: My Last Words on => vs comma
Message-Id: <MPG.12137aca1e7821a1989de1@nntp.hpl.hp.com>
In article <19990805172653.47299.qmail@hotmail.com> on Thu, 05 Aug 1999
13:26:53 EDT, Perl King <perlking@hotmail.com> says...
[in yet another thread, despite my previous observation! What a total
IMBECILE you are!]
> The point of my last post was to show that you can NOT use the
> corresponds-to operator everywhere you use the comma operator.
> In the case of the open example
>
> open PW => '/etc/passwd';
>
> it causes a syntax error. It may cause unexpected errors in
> other code. In short, I see no reason to use "=>" instead of ",".
> The comment that "it looks better" just doesn't wash. A comma is
> used in virtually all programming languages to separate arguments
> and is easily recognized by programmers.
What about separating classes of arguments? Extra visual semantics.
> The => can be confused
> with a structure pointer or branch operator.
And '=' can be confused with '==' and '!' can be onfused with '|' and
... Talk about a lame argument! Stick to COBOL, buddy (assuming youve
ever heard of it, of course).
> "=>" also requires
> extra keystrokes, and may be less efficient.
Extra visual semantics. And what kind of dumb asserstion is 'may be
less efficient'. Either it is or it isn't. If you think it might be,
why not measure it and enlighten us all, instead of spewing FUD?
> I have not see it
> used anywhere in Perl books or standard code except for hash
> initialization.
Then you don't read enough books. Let's see:
Programming Perl, p. 94: The => digraph is mostly just a synonym for
the comma operator. It's useful for *documenting* arguments that come
in pairs. It also forces any identifier to the left of it to be
interpreted as a string. [Emphasis supplied.]
[My extension of the visual semantics is to document arguments that come
in two classes, such as 'sprintf FORMAT => LIST'.]
The Perl Cookbook, Recipe 10.7:
thefunc(INCREMENT => "20s", START => "+5m", FINISH => "+30m");
...
[It may end up as hash initialization, but where it is, it is nothing
more than a paired and literalized argument list.]
Perl: The Programmer's Companion, pp. 235-6:
print $query->start_html(-title => 'Unexpected Error');
...
Instead of a simple list of argument values, you can provide a list of
pairs, usually written, as I have here, using the => symbl normally used
for hashes. ...
Named arguments are not a new language feature. They are still passed
in @ARG (remember, => is just fancy comma). ...
Had enough, dingbat?
> Using "=>" instead of "," just because you CAN
> makes me think of someone who prefixes numeric constants with "+" since "it
> makes them stand out more".
Extra visual semantics.
$rounded = int($value + ($value >= 0 ? +0.5 : -0.5));
> My advice? Use the language as it was meant to be used, and don't
> try to decorate it! Perl is already beautiful enough as is.
The language was meant to be used in More Than One Way, twit! There are
plenty of other languages for you to use if you enjoy stylistic
straitjackets.
As you obviously have not had the courtesy to look at the thread from
comp.lang.perl.moderated that I referred to earlier -- in what you have
made yet another thread -- I'll quote it here for your benefit:
<URL:http://x23.deja.com/[ST_rn=ps]/getdoc.xp?AN=499000536>
<BEGIN minimally edited quote>
When Uri Guttman and I asked for comments about our forthcoming paper on
sorting, I received the following ...:
> ... I have one suggestion, and it's one that I can't possibly
> make strongly enough. I'm begging and pleading. Namely:
>
> . please convert => back to , so as to conform to standard/common
> perl coding practice. You get plenty of visibility on usenet and
> mailing lists to innoculate the newbie masses with this meme; but
> in front of the knowledgeable Perl crowd it just makes you look silly.
> Or, as tchrist would say, "it will just get you talked about".
[tchrist also reviewed the paper, and didn't comment on this issue.]
> Please. I'm groveling.
>
> hand,
...
Up, please! Begging and pleading is fine, but groveling is so unseemly.
:-)
It was later suggested that I post my response here 'in front of the
knowledgeable Perl crowd' for your reaction.
The '=>' Apple(s)-from-Oranges List Separator
The '=>' notation seems to have been invented for use in hash
initialization, where it serves to distinguish the different natures of
the two members of each argument pair: key and value. Compare these two
statements for clarity:
my %hash = ( 'foo bar', 'abcdef', 'bar none', 'x y z' );
my %hash = ( 'foo bar' => 'abcdef', 'bar none' => 'x y z' );
I deliberately subverted the magical quoting that => applies to its left
operand, as that is not relevant to my point.
I think that there are strong psycho-semantic benefits in using => in
another context: to separate what is really part of the operator of some
functions from the actual operands. The first argument is often a
specification that is fundamentally different from the arguments that
follow, and relates in some way to all of them.
Although the pseudo-syntax may be documented as
function LIST
in many cases it is, in fact,
function SPECIFICATION 'applied to' LIST
Now, the vanilla way of writing 'applied to' is the comma, but that is
also used as the list separator. Using => conveys the different nature
of the first element from the succeeding members of the list.
For example, compare these two for clarity:
my $string = join $sep, $foo, $bar, $baz;
my $string = join $sep => $foo, $bar, $baz;
This proposed style applies to the functions listed next. Note the
inconsistencies in the syntaxes from perlfunc, with the recognition in
most that the first argument is 'not like the others'.
grep|join|map EXPR,LIST
pack|unpack TEMPLATE,LIST
printf|sprintf FORMAT, LIST [fixed in the errata of the Blue Camel]
chmod|kill LIST [oops; the first argument is 'different']
chown|utime LIST [the first two arguments are 'different']
...?
I would not use => for push/unshift, because it points the wrong way;
the first argument is the primary operand, not a specification to be
applied to the rest of the list. On the other hand, => might be
appropriate with 'split', even though the operand list has only one
element (plus an optional count). And 'rename $file1 => $file2;' is
just too cutesy for my taste.
I think this 'fancy comma' *qualitative* list separator may usefully
enrich Perl style. Or will it just get me talked about, as warned?
<END QUOTE>
Now, O noble Perl King, what was it you wanted to add to this discourse,
other than "I don't like it, waaah!"?
Intelligent comments, preferably from those who have read the thread in
c.l.p.moderated, are of course welcome, now that the subject has been
forced onto this forum.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 5 Aug 1999 13:29:48 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: My Last Words on => vs comma
Message-Id: <37a9e62c@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Perl King" <perlking@hotmail.com> writes:
So, Larry, since when have you taken to slumming at snotmail?
:The point of my last post was to show that you can NOT use the
:corresponds-to operator everywhere you use the comma operator.
So what?
:I have not see [sic] it used anywhere in Perl books or standard code
:except for hash initialization.
Have you read the manpage for the constant.pm pragma lately?
It hazs things like this:
use constant PI => 3.14159265358979;
There's no hash there, of course. Neither is there in the Perl
Cookbook's use of the comma-arrow for named parameter passing
in @_:
thefunc(START => "+5m", FINISH => "+30m")
Meanwhile, in Chapter 4 of the Perl Cookbook we find this:
$sepchar = grep(/,/ => @_) ? ";" : " ,";
Do you understand why I did that? Because there are already too many
commas! I didn't want it do get lost.
This is the same basic reason as what I wrote in Chapter 9,
where it mentions
join($; => $x, $y, $z)
or in non-PCB code I just demo'd using:
#!/usr/bin/perl -w
print STDERR "Oh no, oh no!\n";
print STDOUT join "\n" =>
"Content-Type: text/plain",
"",
"This is a test of errors before output.",
"Did it work?",
Then there are the more, well, creative, uses in Chapter 16:
kill 9 => $pid;
kill -1 => $pgrp;
kill USR1 => $$;
kill HUP => @pids;
if (kill 0 => $minion) { ... }
:My advice? Use the language as it was meant to be used, and don't
:try to decorate it!
Do you already forget poetry, sir? Please produce a quote from Larry
proving that this is what he meant. Considering that Larry editing the
Perl Cookbook and didn't even produce the lightest of clucks in reviewing
the cited material, I suspect you shall be hard-pressed to produce such
a quote.
--tom
--
Welcome to Microsoft.
Please set your watch back 20 years.
------------------------------
Date: Thu, 05 Aug 1999 19:39:20 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: My Last Words on => vs comma
Message-Id: <slrn7qjocm.pps.*@dragons.duesouth.net>
On 5 Aug 1999 18:36:42 GMT, gbacon@itsc.uah.edu (Greg Bacon) enriched us
with:
: In article <19990805172653.47299.qmail@hotmail.com>,
: "Perl King" <perlking@hotmail.com> writes:
: : I have not see it used anywhere in Perl books or standard code except
: : for hash initialization.
:
: All my Perl books are out on loan. Tom, does PCB use => in other
: contexts? There may be books on the way that do it. What's your
: point?
cookbook.examples/ch04/commify_series:21: my $sepchar = grep(/,/ => @_) ? ";" : ",";
cookbook.examples/ch06/grepauth:15: my $expr = join $condition => map { "m/\$pattern[$_]/o" } (0..$#pattern);
cookbook.examples/ch13/Counter:5: return bless \$start => $class;
cookbook.examples/ch16/ch16.code:305:kill 9 => $pid; # send $pid a signal 9
cookbook.examples/ch16/ch16.code:306:kill -1 => $pgrp; # send whole job a signal 1
cookbook.examples/ch16/ch16.code:307:kill USR1 => $$; # send myself a SIGUSR1
cookbook.examples/ch16/ch16.code:308:kill HUP => @pids; # send a SIGHUP to processes in @pids
cookbook.examples/ch16/ch16.code:312:if (kill 0 => $minion) {
cookbook.examples/ch17/biclient:27: kill("TERM" => $kidpid); # send SIGTERM to child
cookbook.examples/ch17/preforker:30: kill 'INT' => keys %children;
And some more.
But, like you said, it doesn't matter.
--Matthew
------------------------------
Date: 05 Aug 1999 12:50:12 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: My Last Words on => vs comma
Message-Id: <yloggmatxn.fsf@windlord.stanford.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
> Then there are the more, well, creative, uses in Chapter 16:
> kill 9 => $pid;
> kill -1 => $pgrp;
> kill USR1 => $$;
> kill HUP => @pids;
> if (kill 0 => $minion) { ... }
I just wrote some code that looks like:
if ($info{summary}) { printf "%11s: %s\n", Summary => $info{summary} }
if ($info{url}) { printf "%11s: %s\n", URL => $info{url} }
if ($info{priority}) { printf "%11s: %s\n", Priority => $info{priority} }
Similar sort of thing. I wanted to make the code easier to follow
visually while still putting the width allocated to the header into a
printf string so that I can tell at a glance that it's 11 spaces.
--
#!/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
------------------------------
Date: 05 Aug 1999 13:52:19 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <a13dxyru7g.fsf@cyclone.jprc.com>
llornkcor@earthlink.net (llornkcor@earthlink.net) writes:
> I agree with you wholeheartedly...
> They are just trying to 'police' this newsgroup.
> I think a moderated perl forum might be a good idea.
Yeah, you might call it 'comp.lang.perl.moderated', even.
---Jason
------------------------------
Date: 05 Aug 1999 12:26:16 -0700
From: Mike Coffin <mhc@Eng.Sun.COM>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <8p6u2qe81wn.fsf@Eng.Sun.COM>
James Meacham <jmeacham@hume.jhuccp.org> writes:
> [...] So while the creator of the language and
> really the language itself manifest an attitude of humanistic
> synthesis, the overwhelming tone of this newsgroup is one of
> nastiness, condescension, and intolerance.
>
> [...] Just curious if I'm the only one, and if I'm the
> only one who has noticed this disparity between the creator and the
> language in contradistinction to the Usenet groups devoted to the
> language.
>
> Peace,
No, you are not the only one who has noticed. Please help change the
tone by posting yourself.
-mike
------------------------------
Date: Thu, 05 Aug 1999 19:06:57 GMT
From: craig_davids@my-deja.com
Subject: Perl is Not Opening a file
Message-Id: <7ocnc8$p08$1@nnrp1.deja.com>
I've been using Perl on an NT 4.0 server as a development platform and
then I port my scripts to a unix server for production. Everything has
been working fine. However, I copied some scripts from UNIX to my NT
server and found a problem with them when executed via the browser.
can't open datafile: No such file or directory at
C:\Inetpub\wwwroot\~Kaf\secure\com_fin\data\read.cgi line 4.
When executed at the command line (using telnet) they work fine. A
simple open, read and display will not work. I even tried creating my
own data file and wrote a less complicated script (see below), checked
that execute was turned on for that directory, installed Perl 5.00.5,
etc. I'm at a loss. Any sugestions?
open(USER_DATA,"test.txt") || die("can't open datafile: $!");
while (<USER_DATA>)
{
($varA, $varB, $varC, $Line) = split (/;/);
print $varA,$varB,$varC,$Line;
}
close (USER_DATA);
print "This program is over\n";
exit 0;
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 19:13:08 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Perl is Not Opening a file
Message-Id: <7ocnnp$pci$1@nnrp1.deja.com>
[In article <7ocnc8$p08$1@nnrp1.deja.com>,
craig_davids@my-deja.com wrote:]
> can't open datafile: No such file or directory at
> C:\Inetpub\wwwroot\~Kaf\secure\com_fin\data\read.cgi line 4.
I see that you have a ~Kaf in the path.
I am not a NT expert. But are you sure that NT supports
the meaning of ~ inside pathnames like UNIX.
--
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 5 Aug 1999 13:00:26 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl is Not Opening a file
Message-Id: <Pine.GSO.4.10.9908051259110.9452-100000@user2.teleport.com>
On Thu, 5 Aug 1999, Makarand Kulkarni wrote:
> I am not a NT expert. But are you sure that NT supports
> the meaning of ~ inside pathnames like UNIX.
Of course, on Unix systems, '~' in a pathname means "there is a tilde in
the pathname". :-) But some shells optionally give it another meaning as
well. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 05 Aug 1999 10:05:05 -0800
From: eric@thejensens.com (Eric Jensen)
Subject: Reading a file into array PERL NEWBIE
Message-Id: <tkkq3.1676$001.807727@WReNphoon3>
I am having trouble reading a file of CSV email addresses into an array.
I am opening the file...but unsure of how to read the file up to a comma
(',') and place the information prior to the comma into an array slot.
Any suggestions accepted.
Eric
eric@thejensens.com
-**** Posted from RemarQ, http://www.remarq.com/?a ****-
Search and Read Usenet Discussions in your Browser - FREE -
------------------------------
Date: Thu, 5 Aug 1999 11:41:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Reading a file into array PERL NEWBIE
Message-Id: <Pine.GSO.4.10.9908051140540.9452-100000@user2.teleport.com>
On Thu, 5 Aug 1999, Eric Jensen wrote:
> I am having trouble reading a file of CSV email addresses into an array.
Have you seen section four of the FAQ? Look for "comma-separated". Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 05 Aug 1999 15:44:25 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: split array with \n?
Message-Id: <37A9E999.3F86F9E@ccrs.nrcanDOTgc.ca>
I am writing a script to execute a program on a list of files, which are
stored to an array. Problem is, the process has trouble moving to
subsequent files after the first one? How can one split the array so
that the process can run on each file? Can one split the array via
newline?
Thanks for any advice.
..Tom
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: 05 Aug 1999 12:57:52 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: split array with \n?
Message-Id: <ylhfmeatkv.fsf@windlord.stanford.edu>
Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> writes:
> I am writing a script to execute a program on a list of files, which are
> stored to an array. Problem is, the process has trouble moving to
> subsequent files after the first one? How can one split the array so
> that the process can run on each file? Can one split the array via
> newline?
I'm sorry, that didn't make any sense at all. Could you possibly post
some code that demonstrates what you're trying to do and what happens and
why it's not what you want?
--
#!/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
------------------------------
Date: 5 Aug 1999 18:26:39 GMT
From: revjack <revjack@radix.net>
Subject: Re: truncation without rounding
Message-Id: <7ocl0v$6d7$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Anno Siegel explains it all:
:revjack <revjack@radix.net> wrote in comp.lang.perl.misc:
:>Anno Siegel explains it all:
:>: <ericp@us.ibm.com> wrote in comp.lang.perl.misc:
:>:>I'm writing a CGI script for calculating a golfers handicap. The number
:>:>produced has to be truncated to the tenths without rounding. I know
:>:>that both printf() and sprintf() will round the last digit, so how do I
:>:>make it NOT round?
:>
:>:int( 10*$number)/10;
:>
:>Can a handicap be zero?
:What if it is? Did you mean to ask, can 10 be zero?
I meant to ask how many is blue, but that makes no more sense than my
original question. Never mind.
------------------------------
Date: Thu, 5 Aug 1999 21:02:37 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Turning off cashing from Perl???
Message-Id: <Pine.HPP.3.95a.990805204653.3617A-100000@hpplus03.cern.ch>
On Thu, 5 Aug 1999, Dan Wilga wrote:
> It's kind of difficult to figure out what you have tried and what you
> haven't from your code sample.
Right. It also has nothing to do with the Perl language, so a tutorial
on proper use of CGI or of the HTTP protocol ought to be a better source
of wisdom.
> The first way is to include this line within the <HEAD> segment of your output:
>
> print qq|<meta http-equiv="pragma" content="no-cache">|;
Which will be blithely disregarded by many cache proxies, since they
have no interest in parsing the contents of documents that pass through
their hands in order to see whether some cargo-culter has hidden a
wannabe-HTTP header in there.
But this is only part of the problem.
> The other method assumes your Web server is expecting an HTTP header in
> the output:
>
> print qq|Content-type: text/html\n|; # notice: just one \n at the end
> print qq|Pragma: no-cache\n\n|; # here there are two \ns because
The "Pragma: no-cache" header is defined to be a request from a
_client_, made towards a server (via any proxies that may be on the
way).
Its usage from a server towards a client is, shall we say, at best "ad
hoc".
There are several ways to influence caching (i.e to promote it or to
inhibit it, whichever the context calls for), in clients (typically
browsers) as well as in proxies. The Expires: header is one. I would
recommend, aside from finding the appropriate group for this discussion,
to consult http://www.mnot.net/cache_docs/ and to cross-reference the
HTTP specification. I would particularly call your attention to this:
http://www.mnot.net/cache_docs/#PRAGMA
Yes, I know that in their usual way, a certain big software vendor
chooses to implement the stuff that the cargo culters use (and in some
cases flagrantly disregard what the interworking specifications
require), but there's still the rest of the WWW to think of, thank
goodness.
good luck
------------------------------
Date: Thu, 5 Aug 1999 12:40:17 -0700 (PDT)
From: Dwayne Retsky <a794636757612661@mailcity.com>
Subject: Re: Why no Perl books at Fry's?
Message-Id: <0933882017c0f62c73b08d8dd13f68c609e21bf54f@mailcity.com>
In article <37a85785.178389453@news.giganews.com>,
PerlCoder@Unix.com (CGI) wrote:
> I went to Fry's Electronics. They have a large selection of computer
> books, bigger than places like Crown and Barnes & Noble. I saw lots of
> books on Java, C++, HTML, MCSE, etc. but I couldn't find anything on
> Perl. So how should one interpret this situation?
I would interpret it as you not being very good at finding books at Fry's
Electronics. The last time I went to Fry's Electronics (just this morning,
in fact) a quick glance at the computer language section revealed a bunch
of Perl books, and even the Perl Resource package.
--
Dwayne Retsky
Mail sent to the address on this posting is rarely, if ever, read.
Please respond to the proper newsgroup.
------------------------------
Date: Thu, 5 Aug 1999 15:56:14 -0400
From: "Flash Fire" <flash_fire@email.msn.com>
Subject: Windows NT + Perl
Message-Id: <#Ve9iz33#GA.472@cpmsnbbsa02>
I am trying to get this script written for Perl to work on NT
I changed the first line of the script to
#!C:\Perl\Perl
can anyone tell me what the default directory for perl is on a nt machine
I installed perl to C:\Perl
but changing the first line didn't seem to work
My System Admin says the cgi-bin is set to execute but when i try to use the
script from the webpage I have setup I get the following
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be
experiencing technical difficulties, or you may need to adjust your browser
settings.
What exactly does this error mean.
Is there something wrong with my script or are the permissions on the
cgi-bin directory setup wrong?
Someone please help me
Thankyou,
Wilderop
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 387
*************************************