[13798] in Perl-Users-Digest
Perl-Users Digest, Issue: 1208 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 28 03:05:30 1999
Date: Thu, 28 Oct 1999 00:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941094310-v9-i1208@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 28 Oct 1999 Volume: 9 Number: 1208
Today's topics:
Re: adding data to beginning of file (Abigail)
Re: adding data to beginning of file (Tad McClellan)
Re: Banner Rotation Theory (Abigail)
Re: Banner Rotation Theory (Philip 'Yes, that's my address' Newton)
Re: Circular buffering (Greg Andrews)
Re: Email::Valid module and rfc compliant addresses (Craig Berry)
Re: Email::Valid module and rfc compliant addresses (brian d foy)
Re: How to round a number? (Iain Chalmers)
Re: How to round a number? <rra@stanford.edu>
Re: length (number of items) of an array (Craig Berry)
Re: linking to perl script to html page. (Max)
Re: quoting confusion in system calls (Abigail)
Re: Scripts that invoke one another via Location: and/o (Ben Blish)
Re: Scripts that invoke one another via Location: and/o <wyzelli@yahoo.com>
Re: Scripts that invoke one another via Location: and/o (Martien Verbruggen)
Re: What makes the web go? (Craig Berry)
Re: What makes the web go? <jjklimeck@home.com.com>
Re: Why does this print 'bar'? <lr@hpl.hp.com>
Re: Why extra junk at end of new file? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Oct 1999 00:31:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: adding data to beginning of file
Message-Id: <slrn81fns4.66b.abigail@alexandra.delanet.com>
Aaron Walker (amwalker@gate.net) wrote on MMCCXLIX September MCMXCIII in
<URL:news:3817A0AE.AB1C957B@gate.net>:
;; I am attempting to write a perl script that writes data to the beginning
;; of a file. The way I plan on doing this is by reading in the current
;; data file into say @data, then writing the current data into the file,
;; then writing the data in @data after the current data. Is there a
;; fuction that does this or another easier way of doing this in perl?
There's no function that does this. But I think putting the stuff in a
scalar is easier than in an array.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 27 Oct 1999 20:16:04 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: adding data to beginning of file
Message-Id: <4k48v7.r7f.ln@magna.metronet.com>
Aaron Walker (amwalker@gate.net) wrote:
: I am attempting to write a perl script that writes data to the beginning
: of a file.
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
You are expected to check the Perl FAQ *before* posting
to the Perl newsgroup you know.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 28 Oct 1999 01:01:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Banner Rotation Theory
Message-Id: <slrn81fplk.66b.abigail@alexandra.delanet.com>
Benjamin Franz (snowhare@long-lake.nihongo.org) wrote on MMCCXLVII
September MCMXCIII in <URL:news:xJkR3.20$Ha7.2774@typhoon01.swbell.net>:
"" In article <cukR3.1583$LR3.273227@news.shore.net>,
"" Scratchie <AgitatorsBand@yahoo.com> wrote:
"" >
"" >Am I missing something? Is there some reason why he can't just run a cron
"" >job regularly to update the static HTML pages with new banners and links?
""
"" Because you have a race condition.
""
"" 1. User browses page with ad banner and is served banner-a
"" 2. Server rotates to banner-b
"" 3. User reads page
"" 3. User clicks on banner-a with fixed link to ad-link script
"" 4. ad-link script serves link to banner-b
"" 5. User goes 'Huh?'
Huh?
Why on earth should clicking on banner-a bring you to the link to
banner-b? After you server the page to the customer, it's quite
irrelevant if you update the page on the server.
The only stupid thing you could do is not update the HTML page,
but update the image. But that wasn't suggested.
Of course, banner ads are evils, and people putting up banner
ads are the devils minions.
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 06:45:16 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: Banner Rotation Theory
Message-Id: <3817f082.348465396@news.nikoma.de>
On Tue, 26 Oct 1999 13:49:44 GMT, snowhare@long-lake.nihongo.org
(Benjamin Franz) wrote:
> The other alternative, Java, has a nasty
>tendency to cause browsers to crash.
And quite a few people turn it off in their browsers, too.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
------------------------------
Date: 27 Oct 1999 22:49:38 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: Circular buffering
Message-Id: <7v8o5i$lfm$1@shell1.ncal.verio.com>
ncherry@home.net writes:
>On 27 Oct 1999 17:37:35 GMT, M.J.T. Guy wrote:
>>In article <slrn81bddi.36g.njc@dmc.uucp>, Neil Cherry <ncherry@home.net> wrote:
>>>I'm interested in using circular buffering in my Perl program. Does
>>>anyone have code examples of how to accomplish this?
>>
>>Use an array, say @buff, to hold the buffer.
>>
>>Then push @buff, $item; # add $item to @buff
>> my $item = shift @buff # take $item from @buff
>>
>>Contrary to what you might guess, these are efficient operations even
>>if the buffer gets large ( O(1) most of the time ), as Perl is careful
>>to avoid unnecessary shifting or copying of arrays.
>
>I see I have caused some confusion but I have gained further knowledge
>in the process. I was unaware of push/pull shift/unshift etc.
>
>What I meant by circular buffers is a fixed size array were a pointer
>points to the current position in the array to put new characters and
>a pointer that points to the last read character.
>
Modify your pointer definitions to be "the position of the last
character written to the buffer" and "the position of the next
character to be read from the buffer", then your circular buffer
is no different than the array described by M.J.T Guy. If you
think about it, re-defining the pointers in that fashion does
not stop it from being a circular buffer.
Index 0 of the Perl array holds the next scalar (character) to be
read via the shift function. Index $#array holds the last scalar
(character) that was written by the push function. Same pointers,
just pointing to slightly different data.
If you want the buffer (array) to be a fixed size, then test the
value of the $#array index before pushing a new character onto the
end. If the array is already at the max size, discard the new
character. That's what you do in your circular buffer, isn't it,
when the pointers indicate the buffer is full of unread data?
After all, a "circular" buffer isn't really circular, is it? It's
a linear buffer where you play games with the read and write pointers
to wrap them around the linear space. And prevent writes from over-
running the reads.
Implemented as a Perl array, you don't have to write two tests to
wrap the pointer to the start of the buffer space (one after reading,
one before writing), and a third test to see if the pointers are
pointing to the same position. You write just one test to see if the
size of the array has reached its max limit. Perl handles the rest
internally.
I'm not saying this is the right solution for your application.
Maybe it isn't. I'm only pointing out that it does match your
description of a circular buffer.
-Greg
--
::::::::::::::::::: Greg Andrews gerg@wco.com :::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
------------------------------
Date: Thu, 28 Oct 1999 04:41:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Email::Valid module and rfc compliant addresses
Message-Id: <s1fl08l3r0891@corp.supernews.com>
Abigail (abigail@delanet.com) wrote:
: brian d foy (brian@smithrenaud.com) wrote on MMCCXLVIII September
: MCMXCIII in <URL:news:brian-ya02408000R2710990948100001@news.panix.com>:
: []
: [] if you want RFC822 compliant email addresses, check out abigail's
: [] RFC::RFC822::Validate module. it uses Parse::RecDescent rather
: [] than a regex kludge. :)
:
: That's RFC::RFC822::Address.
Just out of curiosity, why that naming scheme for RFC module groups? Why
not RFC::822::Address?
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Thu, 28 Oct 1999 00:44:08 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Email::Valid module and rfc compliant addresses
Message-Id: <brian-2810990044080001@39.new-york-71-72rs.ny.dial-access.att.net>
In article <s1fl08l3r0891@corp.supernews.com>, cberry@cinenet.net (Craig Berry) wrote:
>Abigail (abigail@delanet.com) wrote:
>: brian d foy (brian@smithrenaud.com) wrote on MMCCXLVIII September
>: MCMXCIII in <URL:news:brian-ya02408000R2710990948100001@news.panix.com>:
>: []
>: [] if you want RFC822 compliant email addresses, check out abigail's
>: [] RFC::RFC822::Validate module. it uses Parse::RecDescent rather
>: [] than a regex kludge. :)
>:
>: That's RFC::RFC822::Address.
oops - sorry about that.
>Just out of curiosity, why that naming scheme for RFC module groups? Why
>not RFC::822::Address?
apparently 5.004 doesn't like package names that start with a digit.
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 28 Oct 1999 14:31:45 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: How to round a number?
Message-Id: <bigiain-2810991431460001@bigman.mighty.aust.com>
In article <5nPQ3.26281$m4.95656863@news.magma.ca>, "Samuel Kilchenmann"
<skilchen@swissonline.ch> wrote:
<-snip->
> Please try what you get on your systems with
> printf("%.0f, %.0f\n", 2.5, 7.5);
> printf("%.1f, %.1f\n", 0.25, 0.75);
> printf("%.2f, %.2f\n", 0.125, 0.375);
> printf("%.3f, %.3f\n", 0.0625, 0.1875);
>
> I am almost sure that on many (*nixish) systems this will print:
> 2, 8
> 0.2, 0.8
> 0.12, 0.38
> 0.062, 0.188
>
> while on others (Win32) it will print:
> 3, 8
> 0.3, 0.8
> 0.13, 0.38
> 0.063, 0.188
MacPerl(5.2.0r4 patchlevel 5.004)
3, 8
0.3, 0.8
0.13, 0.38
0.063, 0.188
5.005_03 built for ppc-linux
2, 8
0.2, 0.8
0.12, 0.38
0.062, 0.188
big
--
"Beginning at about 72 seconds, a series of events occurred
extremely rapidly that terminated the flight."
<http://www.ksc.nasa.gov/shuttle/missions/51-l/mission-51-l.html>
------------------------------
Date: 27 Oct 1999 22:35:42 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: How to round a number?
Message-Id: <ylaep4rqs1.fsf@windlord.stanford.edu>
Samuel Kilchenmann <skilchen@swissonline.ch> writes:
> Its in the FFAQ where you find the answer that Perl has no round
> function and that you could use (s)printf instead.
That is a rounding function.
> Usually, though, we can just use sprintf. The f format lets you
> specify a particular number of decimal places to round its argument
> to. Perl looks at the following digit, rounds up if it is 5 or
> greater, and rounds down otherwise.
> This last sentence is simply wrong.
Correct. It depends on the host rounding mode.
> printf("%.0f, %.0f\n", 2.5, 7.5);
> printf("%.1f, %.1f\n", 0.25, 0.75);
> printf("%.2f, %.2f\n", 0.125, 0.375);
> printf("%.3f, %.3f\n", 0.0625, 0.1875);
> I am almost sure that on many (*nixish) systems this will print:
> 2, 8
> 0.2, 0.8
> 0.12, 0.38
> 0.062, 0.188
That's a valid IEEE rounding mode (round to nearest even).
> To ask the question once more: why is there no round function in Perl
> with the same behavior on all platforms?
Because floating point arithmetic doesn't work the same on all platforms,
I'd imagine.
--
#!/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: Thu, 28 Oct 1999 04:39:35 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: length (number of items) of an array
Message-Id: <s1fks7u6r0831@corp.supernews.com>
Abigail (abigail@delanet.com) wrote:
: Daniel Krajzewicz (krajzewicz@inx.de) wrote on MMCCXLVIII September
: MCMXCIII in <URL:news:3816E60E.1EAD5366@inx.de>:
: $$
: $$ How do I get the number of items (the length of) an array ?
:
: while (@array) {$count ++; shift}
But after that infinite loop completes, as the last protons are decaying,
how do we finally get the length of @array? Or is this optimized to
measure the length of empty arrays?
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Thu, 28 Oct 1999 04:40:40 GMT
From: nihilist@kenobiz.com (Max)
Subject: Re: linking to perl script to html page.
Message-Id: <3817d3bf.196950953@news.acronet.net>
SSI perhaps?
On Wed, 27 Oct 1999 18:06:45 -0400, Tom Kralidis
<tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
>Hi,
>
>I want to make an existing html page a derived-cgi page, however, I
>don't want people to update their links / bookmarks.
>
>The page lies at localhost:/http/docs/index.html
>
>I would like the address to stay the same, but for the file to point at:
>
>localhost:/http/cgi-bin/index.pl
>
>..without a redirect, without the user knowing.
>
>Can this be done?
>
>I've tried ln -s, but the output page shows the perl scripting in
>addition.
>
>Any info would be valued.
>
>..Tom
------------------------------
Date: 27 Oct 1999 23:27:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: quoting confusion in system calls
Message-Id: <slrn81fk51.66b.abigail@alexandra.delanet.com>
Eric Smith (eric@fruitcom.com) wrote on MMCCXLVIII September MCMXCIII in
<URL:news:slrn81clj0.ut8.eric@plum.fruitcom.com>:
// I am wasting much time on fiddling with quoting especially in system calls
// like this one:
//
// system "mv /d/e/erwin/* '/d/e/erwin/' . $erwin . '_CheckTo_' . $user . $myd"
//
// Once I have used the `"' to surround the system command then I cannot use
// it again, which is most inconvenient when mixing literals and variables.
// Should I be using the q and qq operators?
No.
What are you trying to do? The above command will try to move all
files/directories in /d/e/erwin that don't start with a dot to
$mydir, then it'll move /d/e/erwin there, then you'll get an error
because you want to move the current directory, $erwin will be moved,
another error, _Checkto_ in the current directory will be moved, another
error, then $user will be moved, and finally, the same error for the
fourth time.
Perhaps you intend to do:
system "mv /d/e/erwin/* '/d/e/erwin/${erwin}_CheckTo_$user$myd'";
That of course gives also an error, unless $erwin starts with a dot.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 28 Oct 1999 04:56:13 GMT
From: bblishA@TblackbeltDO.Tcom (Ben Blish)
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <3817d3aa.98236594@news.montanavision.net>
On Wed, 27 Oct 1999 20:44:13 -0700, Tom Phoenix <rootbeer@redcat.com> wrote:
>On Thu, 28 Oct 1999, Ben Blish wrote:
>
>> A gentle reminder to read the docs. OK. I have been. I still am. The
>> Perl docs, specifically, don't really address this (probably becuase
>> its in a netherland between perl and cgi, but then again, they're
>> *really* bad docs, so maybe it's just because they're so badly
>> done...)
>
>I wouldn't say that. I'd say that the Perl docs don't cover everything
>you'd want to do with CGI programming, in much the same way as the owner's
>manual for a Mercedes-Benz doesn't tell very much about driving to
>Disneyland.
Well, I'd say they don't cover everything about Perl itself. Like,
for built in functions, they don't tell you what the return value(s)
are, statewise, as one simple for-instance.
>Here's a general rule: If the problem can possibly be expressed without
>mentioning Perl, the Perl docs aren't the best place to start looking for
>the answer.
Sounds fine. The one I was working on can't be expressed that way, though;
nonetheless, the answer doesn't appear to be in the PD's, except perhaps
indirectly. :)
>> All I want to know is how to (or if you can) stuff incoming parameters
>> into a service request (IE Location:...) so that it looks like it came
>> from a form - so the CGI script won't be concerned with a difference.
>
>Sure, you can do that. (If I understand you correctly.) Many programming
>languages - Perl among them - have the ability to send HTTP requests to
>webservers. If you're doing this in Perl, you could use the LWP bundle
>from CPAN.
I know I can send the request. The question was, and is, how to feed them
to Perl scripts in *particular* and how they are then accessed *in particular*.
I got an email that was quite enlightening about how POST uses
stdin and the POST uses the ?yadda=yadda query interface, which was exactly
what I was asking, and again, which doesn't appear to be easily findable,
or existant, in my copy of Perldocs. It was nice to have a specific answer,
I can tell you that. :) CPAN isn't of interest at this point, I want to know
how things work. Maybe later I'll use other people libraries.
>> Besides the plain fact that counters themselves are very useful in some
>> situtations I ccould name at the drop of a penguin's hat,
>
>Sure, counters are useful. I have one in my kitchen that's handy for
>holding up my toaster. :-) But the kind which say "you are visitor number
>12345 to my web page" are useful only for impressing those who believe in
>them, much like the Tooth Fairy.
Ever were that so (and it isn't), it's no justification for the Perldocs
to express such a moronic opinion on all such ose of flock().
Imagine a site where there are numerous places to visit. Imagine now that
there is a limited amount of manpower to enhance the site. Would it, or
would it not, be useful to know which pages are the msot heavily travelled?
From where I sit, knowing means you can direct your limited efforts to the
pages that benefit the most people. The counter doesn't have to show to be
useful, and the perldocs don't make any distinction, they just hammer on this
silly idea that they are inherently NON-useful, which is a load of bunkum.
Siimilarly, if a site is commercial, it is useful to know where people are
travelling the most, reloading, whatever - reloading in itself may be useful
information on a page that updates on a reload (maybe images of an ongoing
space mission or something. What's popular?)
Also, things like shopping carts can - and are - implemented using
strightforward counters, and that's just as valid as any other use.
To get one's knickers in a knot and snottily proclaim that "they have no
use" is to show only myopia. It reeks of classic net-geekage, and not
much else. When things have a use, they have a use. And it doesn't
matter if they have a use to anyone but the one who wants to use them.
The net isn't Stalinist Russia.
And finally, when someone - anyone - is pleased by placing a hit counter
on a page, then it's not up to me, certainly, to say that this is an
invalid use of anything. "Judge not, lest ye look like a geek." I think
that might be in the Boomer Bible or something. :)
>Have fun with Perl!
Having a great time, mostly. I just tend to get a little resistant
when I see the equivalant of schoolyard finger pointing. And let me thank
the person who answered my PERL question by email. :)
Thanks again for replying, Tom.
--Ben
------------------------------
Date: Thu, 28 Oct 1999 14:51:33 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <w3RR3.5$5I2.1543@vic.nntp.telstra.net>
Ben Blish <bblishA@TblackbeltDO.Tcom> wrote in message
news:38161870.169658264@news.montanavision.net...
> I have a situtation where I'm redirecting a browser from
> a CGI script (script1.pl) which is running, to another,
> (script2.pl) because no cookie was found. script2.pl does
> some testing of the browser. If the browser is found able
> to handle cookies, it's given the one it was missing, and
> sent back to script1.pl with the right cookie; at that
> point, script1.pl can continue normally. This all works
> fine.
>
> However, script1.pl has an environment that carries some
> parameters from the HTML page that initiated it;
> For example, such-and-such a button was pressed, or
> such-and-such an item was selected from a dropdown list.
>
> I need to carry those parameters to the second CGI script
> that I'll invoke with...
>
> print "Location: http://www.domain.com/cgi-bin/script2.pl\n\n";
>
> ...because if the browser can handle cookies, and I re-invoke
> script1.pl, I need to hand off the selections that were made.
> Otherwise, the HTML page will need to be re-submitted, which
> seems needlessly onerous for the surfer.
>
> So, my questions revolve around:
>
> o Is there a way to preserve or copy the enviroment of script1.pl
> so that script2.pl sees them just as script1.pl did? Then,
> this concept could be extended so that script1.pl could be
> called again from script2.pl and "think" it was invoked
> from the original HTML page, which would be perfect.
>
> o Failing that, is there a way to pass parameters to script2.pl
> in or on the URL, much as a local anchor can be passed on the
> end of a regular anchor:
>
> <a href="http://www.domain.com/boo.html"></a>
> <a href="http://www.domain.com/boo.html#localname"></a>
>
> o Failing either of those, any suggestions in any other realm,
> pointers to the PERL docs, etc.?
>
> Thanks for any assistance on this.
>
> --Ben
>
I have just gone through something not entirely dissimilar, and found that
printing a html form with hidden fields for the variables worked OK.
Since that involved user input (do the form again) which you don't want,
some sort of SSI type function to submit the form to script2. Maybe write a
temporary shtml and write a location header with script1 which points to the
shtml. That should auto submit the form with hidden fields, to script2 and
something similar to come back to script1. Bit cumbersome, but it is the
only way I can think of to achieve what you want.
Wyzelli
------------------------------
Date: Thu, 28 Oct 1999 06:22:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <LYRR3.258$z73.7547@nsw.nnrp.telstra.net>
On Thu, 28 Oct 1999 04:56:13 GMT,
Ben Blish <bblishA@TblackbeltDO.Tcom> wrote:
> Imagine a site where there are numerous places to visit. Imagine now that
> there is a limited amount of manpower to enhance the site. Would it, or
> would it not, be useful to know which pages are the msot heavily travelled?
And normally, you get that information from access logs. They will
tell you at least as much as a counter.
Martien
--
Martien Verbruggen |
Interactive Media Division | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd. | from a rich salesperson.
NSW, Australia |
------------------------------
Date: Thu, 28 Oct 1999 05:12:07 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: What makes the web go?
Message-Id: <s1fmp7q5r0822@corp.supernews.com>
brian d foy (brian@smithrenaud.com) wrote:
: >Experimenting with Perl CGI apps would certainly be a wise course.
: >Whether or not you end up using these technologies, you'll learn a lot
: >about the underlying mechanisms of the web which will serve you well with
: >any technology you choose.
:
: although CGI might be an interesting place to start, it's not what
: you want to be doing for a high traffic site. mod_perl, servlets,
: or other such technologies are a lot better. mod_perl and Apache::DBI
: are just about the best things in the world ;)
Absolutely. But simple Perl-based CGI is easier to set up on a home
machine, easier to understand, and lets you 'see' more of the
protocol-layer stuff underlying the Web, which comes in handy when you
move up to the bigger guns.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Thu, 28 Oct 1999 06:10:47 GMT
From: Jonah Klimack <jjklimeck@home.com.com>
Subject: Re: What makes the web go?
Message-Id: <8+QXOCP2AXSJdMTpE7VLxmoZjNcQ@4ax.com>
On Thu, 28 Oct 1999 05:12:07 GMT, cberry@cinenet.net (Craig Berry)
wrote:
>brian d foy (brian@smithrenaud.com) wrote:
>: >Experimenting with Perl CGI apps would certainly be a wise course.
>: >Whether or not you end up using these technologies, you'll learn a lot
>: >about the underlying mechanisms of the web which will serve you well with
>: >any technology you choose.
>:
>: although CGI might be an interesting place to start, it's not what
>: you want to be doing for a high traffic site. mod_perl, servlets,
>: or other such technologies are a lot better. mod_perl and Apache::DBI
>: are just about the best things in the world ;)
>
>Absolutely. But simple Perl-based CGI is easier to set up on a home
>machine, easier to understand, and lets you 'see' more of the
>protocol-layer stuff underlying the Web, which comes in handy when you
>move up to the bigger guns.
Perfect! I'm motivated now, already bought some perl books, I'm ready
to go!
But If I ever get a high traffic site like yahoo, I'll hire someone
else to do the programming =)
Thanks to everyone for replying to my post.
------------------------------
Date: Wed, 27 Oct 1999 23:04:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Why does this print 'bar'?
Message-Id: <MPG.1281875a3ecbf36398a149@nntp.hpl.hp.com>
In article <RZOR3.185$z73.4674@nsw.nnrp.telstra.net> on Thu, 28 Oct 1999
02:58:57 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> On Wed, 27 Oct 1999 18:04:12 -0700,
> Larry Rosler <lr@hpl.hp.com> wrote:
> > In article <Pine.GSO.4.10.9910272025580.2694-100000@crusoe.crusoe.net>
> > on Wed, 27 Oct 1999 20:27:27 -0400, Jeff Pinyan <jeffp@crusoe.net>
> > says...
> >
> > ...
> >
> > > $s = ($n == 1) ? 'foo' : 'bar';
> >
> > I'm tired of seeing those superfluous parentheses in every single one of
> > the four answers posted so far. The precedence of ?: is just higher
> > than that of assignment. However, as they say, "No harm, no foul."
>
> Two reasons why I always include them:
>
> 1) It's visually much clearer what is going on
I was triggered in my gripe by an article on precedence and parentheses
by mjd in TPJ #15, which I just read today.
To me, over-parenthesizing adds visual clutter. mjd discusses
2 + (3 * 4)
which adds no value compared to
2 + 3 * 4
and reveals a lack of certainty about the precedence rules. Similarly,
if ((2 < $x) && ($x < 5)) { ...
etc. And
$s = ($n == 1) ? 'foo' : 'bar';
On the other hand, expressions using << or >> or & or | get me to
parenthesize, because of a lack of certainty about the precedence rules.
> 2) I program a lot in C. They're mandatory there
Gosh, that's news to me. And I thought I knew C a lot better than I
know Perl.
#include <stdio.h>
main() {
int x, y = 1, z = 2, w = 3;
x = y == 1 ? z : w;
printf("x = %d\n", x);
}
Output:
x = 2
> I don't believe in leaving out brackets and/or other separation
> characters just to get a slightly shorter line of code. Some of the
> perl golf here makes me shudder, especially when people start leaving
> out spaces to get a shorter line. Any production code I have will have
> many superfluous visual guides in the code. If that is a problem, then
> you may as well not use spaces or indents, or even newlines at all.
I agree completely about spacing for readability, even in golf code.
> Just like you may be tired of seeing the superfluous parenthese, I am
> tired of reading code that is badly formatted, or where people haven't
> bothered making code easy to read. To me that's more important. And I
> might as well give the right example, then :)
Yes, also.
> Rereading that, I realise it sounds a bit annoyed/irritated/whatever.
> That wasn't my intent. But I'm not gonna change it either :)
Nor I. :)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 Oct 1999 23:37:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why extra junk at end of new file?
Message-Id: <slrn81fknj.66b.abigail@alexandra.delanet.com>
Jon (jmonroe.easystreet@com.spam.sucks.my.ass.com) wrote on MMCCXLVIII
September MCMXCIII in <URL:news:38163d46.11440580@news.easystreet.com>:
()
() I'm writing a CGI script that requires I create a file. Everything is
() working fine, except one rather peculiar and quite annoying thing.
() After I close the file, I find information I had written once in the
() middle somewhere is being written again.
Are you using proper locking? Or all multiple instances of the
program all writing to the same file at once?
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
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 1208
**************************************