[13382] in Perl-Users-Digest
Perl-Users Digest, Issue: 791 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 14 11:22:02 1999
Date: Tue, 14 Sep 1999 08:05: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 Tue, 14 Sep 1999 Volume: 9 Number: 791
Today's topics:
And the band played Waltzing Matilda (Excession)
Anyone know what "premature script header means"? (Lisa Saari)
Re: Anyone know what "premature script header means"? <espen@nextel.no>
Re: Anyone know what "premature script header means"? <leon@solatis.com>
Re: Array Problems (elephant)
Re: Bidirectional client (Kragen Sitaker)
Re: Faxing Script (Bbirthisel)
Re: file renaming or copying <tom.kralidis@ccrs.nrcanDOTgc.ca>
Re: Greetings from a Newbie (Kragen Sitaker)
Re: Greetings from a Newbie (Matthew Bloch)
Re: Help with game level tool (Kragen Sitaker)
Re: how can i list a directory into a browser?? <c4jgurney@my-deja.com>
Re: how can i list a directory into a browser?? <c4jgurney@my-deja.com>
Re: How to download page/image? (Kragen Sitaker)
Re: Pattern matching is hard :-( (elephant)
Re: playing sound files (Kragen Sitaker)
Re: Programmer's Editor (Kragen Sitaker)
Re: proxy-server problem with perl (Kragen Sitaker)
Re: rand questions (Kragen Sitaker)
Re: rand questions (Larry Rosler)
Re: rand questions (elephant)
Re: Reading files on a remote server ???????? (Kragen Sitaker)
Re: REQ: tell-a-friend script chetohevia@my-deja.com
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 14 Sep 1999 14:06:04 GMT
From: daccles@ozemail.com.au (Excession)
Subject: And the band played Waltzing Matilda
Message-Id: <37e055b7.39615744@news.ozemail.com.au>
Lo, amid much gnashing of teeth and brandishing of killfiles, another sad
decrepit headstrong fool[0], chanting 'why does this guy bother me so much?'
plonks me into his/her/its text-only 24 lines per screen, monochrome, no doubt
methane powered, Linux hosted newsreader.
The care factor continues to hardly ping the relevant detectors, and USEnet
continues to function as if nothing has happened.
The same cannot be said for my poor suffering 'run by volunteers' ISP, which
has had mondo problems since someone posted an URL relating to moi, into that
den of indecent sycophants and wannabe godlets, #perl. The ISP didn't
precisely -blip-, it just shut down for 24 hours or so, as 'denial of service'
attacks were aimed at the main server and the web proxy. Details are not
forthcoming.[1]
Sigh.
If people are going to attack me, it would be so much less disruptive if they
limited the collateral damage.
Amused to have someone send email to abuse@ozemail.com.au, suggesting that I
had somehow 'nuked' them. I wonder if that was the action of a petulant
'Amagosa', Master Jeffrey 'godlet' Wheeler (jsw@toldyouso.com), reacting to the
local crowd of IRC idiots^H^H^H^H^H^H^Hacquaintances who have learnt that just
changing their nickname to 'excession' and subsequently trolling in #perl, gets
them more of a reaction (and therefore thrill?) within a few seconds, as they
would eke from entire -days- worth of normal IRC traffic. Heady stuff.
It is with some regret that I find *.ozemail.com.au bot-banned (via 'select')
from #perl. Heck, only 200,000 users affected by that crazy ban. Perhaps if
someone with a clue could have limited the damage there, by banning
*can*.ozemail.com.au, thus only affecting the Canberra Ozemail contingent?
Similarly, the entire *.pcug.org.au domain continues to be bot-banned on #perl.
A ban that has been in place since August 1998. You're such a nice guy,
Amagosa. Perhaps it would be simpler just to ban *.au in #perl and be done
with it entirely?[2]
[0] Name(s) elided to prevent possibly explosive egoboost.
[1] The poor administrators of the ISP in question merely referred to
'unexpected problems'.
[2] A ban on *.au wouldn't stop my remote shell IRC sessions either :-)
Funnily enough, I'm in #perl on a semi-permanent basis under a different
nickname. Watching the inanity from a position of 'trust' has reasonable
amounts of laugh-track material associated with it. "Hey, looook, it's
Excession, quick, bring out the bans" (four malformed ban attempts later)
"Phew, that was close. Karma++ all round!" <fx shakes head at the futility
of it all> And this kind of asinine activity from "respected" authors and
supposed movers and shakers within the Perl community. Tut tut, Randal!
Dac
--
David Andrew Clayton # Please remove NOSPAM when
dac@NOSPAM.pcug.org.au # sending email replies.
I post therefore I am. # ICQ 6862357 : ObWierd 1999 / 3 = 666.33333333333
------------------------------
Date: 14 Sep 1999 14:16:10 GMT
From: sculptural@aol.comnojunk (Lisa Saari)
Subject: Anyone know what "premature script header means"?
Message-Id: <19990914101610.01941.00000054@ng-fz1.aol.com>
My scripts aren't going through and are instead coming back with a 500-Internal
Server Error message. It does tell me that the script has "a premature script
header". Can someone please respond ASAP!
Thanks a lot!
Lisa M. Saari
------------------------------
Date: Tue, 14 Sep 1999 16:29:56 +0200
From: Espen Myrland <espen@nextel.no>
Subject: Re: Anyone know what "premature script header means"?
Message-Id: <37DE5BE4.3EF67828@nextel.no>
The error is probably exactly what the message is telling you.
look in your web servers error log,
it will usually tell you.
espen
lisa Saari wrote:
> My scripts aren't going through and are instead coming back with a 500-Internal
> Server Error message. It does tell me that the script has "a premature script
> header". Can someone please respond ASAP!
> Thanks a lot!
> Lisa M. Saari
------------------------------
Date: Tue, 14 Sep 1999 17:06:51 +0200
From: "Leon Mergen" <leon@solatis.com>
Subject: Re: Anyone know what "premature script header means"?
Message-Id: <7rlo1n$6am$1@zonnetje.nl.uu.net>
probably you forgot :
print "Content-type: text/html\n\n";
--
- Leon (leon@solatis.com)
http://www.solatis.com/
Lisa Saari wrote in message
<19990914101610.01941.00000054@ng-fz1.aol.com>...
>My scripts aren't going through and are instead coming back with a
500-Internal
>Server Error message. It does tell me that the script has "a premature
script
>header". Can someone please respond ASAP!
>Thanks a lot!
>Lisa M. Saari
------------------------------
Date: Wed, 15 Sep 1999 01:34:18 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Array Problems
Message-Id: <MPG.1248f9e6a820cb08989cca@news-server>
Sam Holden writes ..
>On Tue, 14 Sep 1999 11:40:15 +0200, Michael Scheferhoff
> <m.scheferhoff@gmx.de> wrote:
>>Hallo,
>>
>>is it possible to put a value in the middle of an array, so that the
>>ones behinds move one place down?
>
>perldoc -q splice
I think I know Sam well enough to say that the following was actually
the intended reply
perldoc -f splice
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Tue, 14 Sep 1999 14:03:26 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Bidirectional client
Message-Id: <OAsD3.9929$N77.776314@typ11.nn.bcandid.com>
In article <37D5C722.74889330@bigfoot.com>,
Govind Shridhare <new_conclusions@bigfoot.com> wrote:
>I was wondering if somebody can show me how you can write a
>bidirectional client using select statements in Perl.
Write a what?
There's an example of select() with UDP in the perlipc document.
Perldoc perlipc.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 14 Sep 1999 13:37:26 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Faxing Script
Message-Id: <19990914093726.01474.00000040@ng-cp1.aol.com>
Hi Martien and Rich:
>For win32 you should be able to treat your fax as a printer, but how
>you pass it the required parameters is specific to the software etc.
>Maybe ActiveState has some win32 specific faxing modules.
Probably not as a printer without special drivers of some sort.
There is a contributed example using Win32::SerialPort on
http://members.aol.com/bbirthisel/alpha.html
I haven't used it, so I can't say how well it works. ActiveState
does not have anything for faxing (or for serial ports) listed on
their site.
On un*x, efax has a command-line interface that would work
with system().
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Tue, 14 Sep 1999 09:54:29 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: Re: file renaming or copying
Message-Id: <37DE5395.F0971AD1@ccrs.nrcanDOTgc.ca>
How are you coding this? Your explanation is vague.
..Tom
dave_pomeroy4266@my-deja.com wrote:
>
> I am trying to either rename a file or copy it. When I attempt to
> rename it the status returns false. When I copy it the status returns
> true but the new file is empty. Anyone have any ideas? I am in win32.
> Thanks for all your help.
> Dave Pomeroy
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
--
-----------------------------------------------------------------------------------------
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: Tue, 14 Sep 1999 13:46:48 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Greetings from a Newbie
Message-Id: <clsD3.9912$N77.774424@typ11.nn.bcandid.com>
In article <37DDF4D2.FE3C1EB3@home.com>,
Tony Peardon <tonypeardon@home.com> wrote:
>Hello Everyone, I am a Newbie. I hate being a Newbie, but
>when one undertakes to learn a new language, be it computer
>based or otherwise, one has little choice.
I agree. So I love to be a newbie :)
> As you all know,
>one of the main characteristics of a Newbie is that a Newbie
>asks lots of questions,
Or reads lots of documentation. Ideally both :)
>I was/am very good with Pascal, and
>could likely make it do things that would surprise even the
>wisest of the Gurus.
Really? I'm interested to hear. Did you ever
- implement tracing garbage collection?
- do on-the-fly compilation?
- build a truth maintenance system?
- bit-bang input and output simultaneously?
- build a compiler that did type-inference or specialization?
- levitate?
- die and come back to life?
>Pascal is a dead language now,
Delphi seems to be going strong.
>1. In what circumstances would you, as a multi-lingual
>programmer, use the Perl language? In what circumstances
>would you not? What might you use instead?
I usually use Perl when I can, and C or C++ when I must. Scheme is a
bit better for list processing, IMHO, and bc is easier to use for
arbitrary-precision numerical expression evaluation. I find bash is
nicer for invoking lots of external programs.
>2. As a strong advocate of Perl, what other languages do you
>recommend, and why?
C is nice for things that are naturally stated in C terms, and it
usually runs faster than Perl. It's also nice for places where you
can't install perl, usually for political reasons. Scheme is nice if
you're playing with languages, and in some cases it's nicer than Perl
(and it is often faster). Microsoft Excel is nice if you're writing
for a non-programmer audience.
I like Tcl for Tk; Tcl/Tk feels more like Tk than PerlTk. Admittedly,
though, I've done a lot more Tcl/Tking than PerlTking, so maybe my
perception will change.
Python looks really cool; I've been playing with it a bit.
>3. CGI = Common Gateway Interface = Huh?
This is an interface between a web server and a 'gateway' program that
translates some other resource (such as a database) into the language
and stateless model of the Web. See http://hoohoo.ncsa.uiuc.edu/cgi/
for more. (See http://www.fastcgi.com/ for more recent developments.)
>4. What is the expected life span of a Newbie?
It depends on how old they are. 75-year-old newbies might have an
expected life span of 5 to 15 years; 22-year-old newbies might have an
expected life span of 50 years or so.
:)
If you're asking how long you'll be a newbie, there's really no answer.
>5. As a Professional Programmer, how much $US (I'm Canadian)
>do you make in a year? Do you make it in bursts, or
>gradually? What country do you work in?
Gradually. USA.
>6. What computer language has been the most useful to you?
>Why?
Probably Perl, because it really helps me get things done.
> Who are you?
I don't know.
>of Newbies, when I am the Guru.
Use neither of those words and everyone will be happier.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 14:18:39 GMT
From: mattbee@eh.org (Matthew Bloch)
Subject: Re: Greetings from a Newbie
Message-Id: <slrn7ts3ej.46a.mattbee@soup-kitchen.demon.co.uk>
In article <37DDF4D2.FE3C1EB3@home.com>, Tony Peardon wrote:
> 1. In what circumstances would you, as a multi-lingual
> programmer, use the Perl language? In what circumstances
> would you not? What might you use instead?
Well, the FAQ has the history of the language and would make good reading
for many of your questions. Personally I've written a little script to
work out my internet phone bills from my system logs, a small MP3 jukebox
which can be operated by IR or over a network connection and a couple of
web server log analysis scripts. A friend has written a rather neat
program which works out text authorship through training (e.g. you can
train it on Wuthering Heights, then further text can be judged as `Bronte'
or `Not Bronte' :-) ). Certainly all of those scripts fall into the
`quick hack' category where I'm sure they'd be more of a chore in other
languages.
I wouldn't advocate Perl for writing games or for projects where
performance is important (where I'd choose C and hand-tuned machine code
instead) but that's not to say you /can't/ do those things in Perl.
> 2. As a strong advocate of Perl, what other languages do you
> recommend, and why?
Errr... depends what you want to do. I wouldn't blindly advocate any
language but tend to use Perl, C and Java for nearly everything these
days.
> 3. CGI = Common Gateway Interface = Huh?
An interface between a web server and a program, so that the program can
generate dynamic web pages. Many CGI programs are written in Perl, but
this is the wrong newsgroup to ask about CGI specifics.
> 4. What is the expected life span of a Newbie?
About two posts if they don't read the Perl FAQ and Abigail is on her toes
:-) Or do you mean how long does it take to learn? You can start writing
scripts pretty quickly
> 5. As a Professional Programmer, how much $US (I'm Canadian)
> do you make in a year? Do you make it in bursts, or
> gradually? What country do you work in?
So far, my VISA bill gets paid by short jobs in the holidays. I think
it's quite hard to place a $ value to knowledge of a particular language.
> 6. What computer language has been the most useful to you?
> Why? Who are you?
Hard to say. My last full-time job involved adding some features to a
hardware-assisted PC emulator for an obscure British computer platform
(RIP Acorn...). This involved writing C, but also getting ARM and Intel
x86 code running safely on the same machine at the same time :) Though
Perl did get a look-in: I ended up writing an upgrade-by-email system for
registered customers where Perl scripts answered emails and dispatched
zip files on the hour. I think this was the first bit of Perl I wrote,
so I was surprised how easy it was to get it working.
But, ermm, good luck, read the FAQ etc. etc. The O'Reilly `Perl in a
Nutshell' book is quite good if you want to get started really quickly and
are familiar with C / UNIX but has irritatingly large sections duplicated
from the standard Perl documentation, so you might try that first.
--
Matthew ( http://www.soup-kitchen.demon.co.uk/ )
------------------------------
Date: Tue, 14 Sep 1999 14:07:44 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Help with game level tool
Message-Id: <QEsD3.9932$N77.776725@typ11.nn.bcandid.com>
In article <6B81952AF2FE0C4D.2575BEF842CB7A36.2D211023EE61ADF9@lp.airnews.net>,
Jeff Ross <ross@eidetic.com> wrote:
>can someone take a shot at this script for me?
One piece at a time. Which part are you having trouble with at the moment?
>chomp ($LEVELNAME = <STDIN>);
> open(HOGFILE, "z:\\hogs\\$LEVELNAME\\wldemd.h") or die "Can't
>open file $LEVELNAME, check name and try again.\n\n";
Very good. You might want to include $! in there so the user can see
why it failed.
>I want to take some values from these files and do some math.
print <LEVDATA> + <LEVDATA>;
>(cut and paste the data to make your own local file)
So I can follow up to your post? I don't even know you!
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 12:22:02 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: how can i list a directory into a browser??
Message-Id: <7rlel1$e87$1@nnrp1.deja.com>
In article <37DE0ACC.A5E84480@ogilvyinteractive.es>,
Abel =?iso-8859-1?Q?Almaz=E1n?= <abel.almazan@ogilvyinteractive.es>
wrote:
> I want to list a directory into a Netscape/Explorer browser, and each
> file i list will have a hyperlink.
>
> How can i do??
>
> Please, answer me quickly
>
> Thanks
This is snipped from a larger prog, but you should be able to modify it
to do what you want.
opendir(DOCDIR,$path) || die "$!";
foreach (readdir(DOCDIR)) {
print "<A href=\"$_\">$_</A> <BR>";
}
closedir(DOCDIR) || die "$!";
HTH,
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
"Sometimes I think the so-called experts actually are experts."
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 14 Sep 1999 13:00:19 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: how can i list a directory into a browser??
Message-Id: <7rlgss$fun$1@nnrp1.deja.com>
In article <7rlel1$e87$1@nnrp1.deja.com>,
Jeremy Gurney <c4jgurney@my-deja.com> wrote:
> This is snipped from a larger prog, but you should be able to modify
it
> to do what you want.
>
> opendir(DOCDIR,$path) || die "$!";
>
> foreach (readdir(DOCDIR)) {
> print "<A href=\"$_\">$_</A> <BR>";
> }
>
> closedir(DOCDIR) || die "$!";
Which won't actually work, doh! (At least not in a CGI environment)
The original had a variable $urlpath which was used in the link, I'm
sure you could do something similar.
Of course there's always the good old fashioned way of getting the web
server to do all this for you by linking to a dir with no index file (or
default etc. etc.).
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
"Sometimes I think the so-called experts actually are experts."
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 14 Sep 1999 12:15:24 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to download page/image?
Message-Id: <w%qD3.9835$N77.765056@typ11.nn.bcandid.com>
In article <37DE0607.35C106E3@profic.ee>,
Anton Klevtsov <Anton.Klevtsov@profic.ee> wrote:
>does anybody know how to download page and image from another WEB server
>to my server?
libwww-perl, aka LWP. See CPAN.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Wed, 15 Sep 1999 01:30:28 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Pattern matching is hard :-(
Message-Id: <MPG.1248f901937cebcd989cc9@news-server>
Mr. Dave writes ..
>There must be someway to grep for a range of some numbers, the
>numbers being given as variables???
just to add to Sam's advice .. the reason why this will not work is that
regex does not have any concept of numbers .. only of characters
any range that you specify will be a range of characters .. not a range
of numbers .. so regex sees '12' as two characters .. ASCII 061 and 062
.. it does NOT see the number twelve
HTH
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Tue, 14 Sep 1999 12:31:57 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: playing sound files
Message-Id: <1frD3.9853$N77.766627@typ11.nn.bcandid.com>
In article <7rkuet$3p6$1@nnrp1.deja.com>, <sophieloo@my-deja.com> wrote:
>I'm new to perl and linux and would like to open and play small midi
>files from within a program, preferably without a time lag. When I
>backquote `play` I get a sox man page which I cannot decipher.
Dunno if I can help you on that. Search freshmeat.net for 'MIDI'? I
don't think sox handles midi.
>One other question... if I ftp a .mid or .wav file from windows should
>I change the extension to .au ?
Definitely not. .au is a different format.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 14:20:12 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Programmer's Editor
Message-Id: <wQsD3.9972$N77.776194@typ11.nn.bcandid.com>
In article <ahQB3.12$kU.208@news.shore.net>,
Scratchie <AgitatorsBand@yahoo.com> wrote:
>Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>: You'd stop getting my ire up if you merely posted a disclaimer
>: "handles basic Perl constructs only, but can be easily fooled by
>: typical code".
>
>Are you implying that the examples you gave before are "typical" Perl
>code?
The examples he posted before are not at all far from being typical
Perl code. I frequently use unorthodox quoting characters (){}|# in
m//, s///, or just q(|q|w), and I frequently use <<heredocs. These
alone require some hefty logic to highlight correctly.
Is there a way to get an annotated parse tree, including character
positions, from the front end of Perl? The best way to parse Perl is
with the Perl parser :)
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 13:26:11 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: proxy-server problem with perl
Message-Id: <T1sD3.9895$N77.770788@typ11.nn.bcandid.com>
In article <7r5414$t48$1@news.gigabell.net>,
Claus Prüfer <pruefer@idnet.de> wrote:
>does someone know how i get an "100%" identifier to open a filename for a
>shopping cart or multiple users online?
You can use cookies, or you can put something in the URL the way J.
Crew does, or you can have people log in.
Not a Perl question, though.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 12:27:53 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: rand questions
Message-Id: <dbrD3.9848$N77.765833@typ11.nn.bcandid.com>
In article <slrn7trsiq.f00.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>And? What is the problem? If you think that rand() will never return
>the same number, you are awfully mistaken. Say you have an array with
>10 elements. You randomly select one. The chance you select index 4 is
>10%. REGARDLESS whether the previous pick was 4 as well. Even if the
>previous 100 picks were all 4, there is still a 10% chance this pick
>will be 4 as well.
If the previous 100 picks were all 4, there is much more than a 10%
chance this pick will be 4, because if the previous 100 picks were all
4, it is certain that your perl has a broken random number generator.
(The chance of the previous 100 picks being 4 in a working perl would
be 1 in 10^100, i.e. a googol to one.)
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 07:30:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: rand questions
Message-Id: <MPG.1247fbddb9b95006989f60@nntp.hpl.hp.com>
In article <dbrD3.9848$N77.765833@typ11.nn.bcandid.com> on Tue, 14 Sep
1999 12:27:53 GMT, Kragen Sitaker <kragen@dnaco.net> says...
...
> If the previous 100 picks were all 4, there is much more than a 10%
> chance this pick will be 4, because if the previous 100 picks were all
> 4, it is certain that your perl has a broken random number generator.
> (The chance of the previous 100 picks being 4 in a working perl would
> be 1 in 10^100, i.e. a googol to one.)
Haven't seen any googols for a while, let alone googolplexes. Can you
come up with one of those? :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 15 Sep 1999 01:26:08 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: rand questions
Message-Id: <MPG.1248f7fc29a45f34989cc8@news-server>
Abigail writes ..
>Gene Senyszyn (scatt@goes.com) wrote on MMCCIV September MCMXCIII in
><URL:news:37DC8A33.A759B41A@goes.com>:
>:: The variable $x gets converted to an integer, however the next random
>:: number can be 4.3333, where the last one was maybe 4.2222, and they both
>:: print the same lines.
>
>And? What is the problem? If you think that rand() will never return
>the same number, you are awfully mistaken. Say you have an array with
>10 elements. You randomly select one. The chance you select index 4 is
>10%. REGARDLESS whether the previous pick was 4 as well. Even if the
>previous 100 picks were all 4, there is still a 10% chance this pick
>will be 4 as well.
I propose that if the previous 100 picks we all 4 then the chances of
this pick being 4 are significantly closer to 100% than to 10% .. along
with the probability that your randomiser function is broken *8^)
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Tue, 14 Sep 1999 12:34:23 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Reading files on a remote server ????????
Message-Id: <jhrD3.9856$N77.766753@typ11.nn.bcandid.com>
In article <937306569.498055@diddley.primus.com.au>,
Stewart Pitt <stewart@xcs.com.au> wrote:
>Apologies for being a bit vague in my initial message.
>
>What I want to do is execute a perl script on my local server that opens and
>file on a remote server for either read, write or append. Then perform
>actions against the file while it still resides on the remote server.
There are several protocols that will let you do this: NFS, SMB, HTTP
(with DAV), FTP, Netware's filesystem protocol, etc. You can probably
use any of them from Perl.
Kragen
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 14 Sep 1999 14:26:53 GMT
From: chetohevia@my-deja.com
Subject: Re: REQ: tell-a-friend script
Message-Id: <7rlluq$jud$1@nnrp1.deja.com>
> This group is a resource for people who are writing Perl programs -
it is
> not a market for stupid CGI programs. If you are unable to find the
> program that you want from one of the free CGI archives then I suggest
> that you either learn Perl and write it yourself or hire a programmer.
The actual non-trivial technical issue in the question, and in the
referral scripts, makes the question a legitimate one, although perhaps
poorly phrased. but it is a question I share: does anyone know how to
identify referring page from a script? I'm looking for something
equivalent to the javascript document.referrer object. does anyone
know how to do that in perl?
cheto hevia.
"they needed bread & medicine, and we had only songs & poems in our
bags" -alejandro casona-
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 791
*************************************