[10765] in Perl-Users-Digest
Perl-Users Digest, Issue: 4366 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 5 22:07:44 1998
Date: Sat, 5 Dec 98 19:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 5 Dec 1998 Volume: 8 Number: 4366
Today's topics:
Re: can match $n times be done? <aqumsieh@matrox.com>
CGI Redirection fairbairn_97@yahoo.com
Re: CGI Redirection (Ronald J Kimball)
Re: CGI Redirection (Aslan00001)
Re: CGI Redirection <gellyfish@btinternet.com>
Re: Fast way to produce block of random bytes? Gerben_Wierda@RnA.nl
Finite State Auto.. <zerocool@montana.campus.mci.net>
help, have to figure perl out in 4 days!! <D.W.E@worldnet.att.net>
Re: help, have to figure perl out in 4 days!! (Ronald J Kimball)
Re: How can I make it impossible to use the browser's b dturley@pobox.com
Re: How can I make it impossible to use the browser's b <hayati@ocf.Berkeley.EDU>
Re: ICQ online pager (Victor B Wagner)
Re: Installing Win32 Perl (was Re: Seeking Win32::DES.p <jbailey@cyberconnect.com>
Re: Installing Win32 Perl (was Re: Seeking Win32::DES.p <gellyfish@btinternet.com>
Re: Is it possible to run a web server on Win95? <gellyfish@btinternet.com>
Re: Is Tcl/Tk better than Perl ? <gellyfish@btinternet.com>
Re: java servlets vs imbedded mod_perl for servers <kalim@erols.com>
Re: Merge Files <group95@allied.demon.co.uk>
Re: newbie file open question (RemarQ User)
Re: Please Help where can i download perl - <gellyfish@btinternet.com>
Re: Question: Ms IIS WWW server releasing resources use <gellyfish@btinternet.com>
simple question about the submit button (Nina Hung)
Re: simple question about the submit button <kennerPIDDLE@xnet.com>
Re: simple question about the submit button <gellyfish@btinternet.com>
Re: simple question about the submit button <kalim@erols.com>
Re: Some questions (Juergen Heinzl)
Re: Some questions <markrame@hotmail.com>
Re: Some questions (Sam Holden)
Re: Some questions (Ronald J Kimball)
Re: the Unix epoch is not the beginning of time (was Re <Russell_Schulz@locutus.ofB.ORG>
Re: the Unix epoch is not the beginning of time (was Re <Russell_Schulz@locutus.ofB.ORG>
Re: using exec cmd bhoylma@uswest.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 5 Dec 1998 18:00:53 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: can match $n times be done?
Message-Id: <x3yaf129p1i.fsf@newton.matrox.com>
donarb@nwlink.com (Don Arbow) writes:
>
> You could also code it this way, alternating word and space runs:
>
> $pat = "^((?:\\w+\\s+){$n}).*";
But that won't succeed if a word contains \W characters like ' , !
. etc ...
original solution is better, although I would write it as:
$pat = "^((?:\\S+\\s+){$n}).*";
Ala
------------------------------
Date: Sat, 05 Dec 1998 23:00:34 GMT
From: fairbairn_97@yahoo.com
Subject: CGI Redirection
Message-Id: <74cduh$4a4$1@nnrp1.dejanews.com>
Hi...
I was enquiring whether any body knows where I can get a CGI script that
redirects URLs to another place automatically... I was planning on doing
something like ML.ORG where they redirect TEST.HOME.ML.ORG to
www.mydomain.com/test/test/test/go.html
Please help.... Email me on fairbairn_97@yahoo.com
He who gives me the correct answer will be placed on the front page of my web
site....... THanx in advance
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 5 Dec 1998 19:46:10 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: CGI Redirection
Message-Id: <1djkwrv.1i25wdp7179iqN@bos-ip-1-113.ziplink.net>
<fairbairn_97@yahoo.com> wrote:
> I was enquiring whether any body knows where I can get a CGI script that
> redirects URLs to another place automatically...
#!/usr/local/bin/perl
print "Location: http://www.example.com/\n\n";
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 6 Dec 1998 02:29:58 GMT
From: aslan00001@aol.comCUTTHIS (Aslan00001)
Subject: Re: CGI Redirection
Message-Id: <19981205212958.00805.00000151@ng-cf1.aol.com>
Your best bet to do this.. is to just simply use html...
ie:
<meta http-equiv="Refresh" content="4; url=http://www.ramapo.edu">
where 4 is the time till redirect and you place in the appropriate web page to
contact.
If you wish to do this in cgi.. using perl.. simple dump and empty page to the
screen with the redirct time set to 0.
I used this same method in designing a web circle.
Aslan
>Subject: CGI Redirection
>From: fairbairn_97@yahoo.com
>Date: 12/05/98 6:00 PM Eastern Standard Time
>Message-id: <74cduh$4a4$1@nnrp1.dejanews.com>
>
>Hi...
>
>I was enquiring whether any body knows where I can get a CGI script that
>redirects URLs to another place automatically... I was planning on doing
>something like ML.ORG where they redirect TEST.HOME.ML.ORG to
>www.mydomain.com/test/test/test/go.html
>
>Please help.... Email me on fairbairn_97@yahoo.com
>
>He who gives me the correct answer will be placed on the front page of my web
>site....... THanx in advance
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
>
>
>
>
>
***************************************************************
* Respond to: stile_at_phazeCUTTHIS@hotmail.com *
***************************************************************
------------------------------
Date: 6 Dec 1998 01:49:43 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: CGI Redirection
Message-Id: <74cnrn$1eu$1@gellyfish.btinternet.com>
On Sat, 05 Dec 1998 23:00:34 GMT fairbairn_97@yahoo.com wrote:
> Hi...
>
> I was enquiring whether any body knows where I can get a CGI script that
> redirects URLs to another place automatically... I was planning on doing
> something like ML.ORG where they redirect TEST.HOME.ML.ORG to
> www.mydomain.com/test/test/test/go.html
>
> Please help.... Email me on fairbairn_97@yahoo.com
>
> He who gives me the correct answer will be placed on the front page of my web
> site....... THanx in advance
>
Me,me,me I want to be on the front page of your web site ...
use CGI.pm the module and read the documentation and find out about the
redirect() method.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Dec 1998 16:30:55 GMT
From: Gerben_Wierda@RnA.nl
Subject: Re: Fast way to produce block of random bytes?
Message-Id: <F3I37J.DwL@RnA.nl>
ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>[A complimentary Cc of this posting was sent to Zenin
><zenin@bawdycaste.org>],
>who wrote in article <912762823.648234@thrush.omix.com>:
>> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>> >snip<
>> : You cannot use rand() because it is not random. Until perl reads from
>> : /dev/random, the maximum you can expect is to get 2, maybe 4 random
>> : bytes from Perl.
>>
>> Or uses random(3), which more system have, along with srandomdev(3)
>> if available (eg, has /dev/random).
>
>Say, on my system (EMX on OS/2) Perl uses random(). It is a BSD
>random() which has only twice as many bits as rand(). I think you are
>confused.
Actually, the question was not how random the bytes were (good pseudo random
is good enough for me here), but how to create a block of 1024 of the as fast
as possible.
Someone said:
$chunk = join "", map chr(rand 1 << 8), 1 .. 1024;
I timed this with the following script:
#!/usr/local/bin/perl
use Benchmark;
my $totalbytes = 0;
my $chunksize = 1024;
my $chunk;
my $count = 0;
my $byteswriten;
timethese( 100, {
'pack+rand+srand+ps' => sub {
my $chunkref = \$chunk;
$$chunkref = '';
# Reset srand with some random situation of the system:
srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
while (length( $$chunkref) < $chunksize) {
$$chunkref .= pack( "L", rand( 2**31));
}
},
'pack+rand' => sub {
my $chunkref = \$chunk;
$$chunkref = '';
while (length( $$chunkref) < $chunksize) {
$$chunkref .= pack( "L", rand( 2**31));
}
},
'join+chr' => sub {
my $chunkref = \$chunk;
$$chunkref = join "", map chr(rand 1 << 8), 1 .. 1024;
}
});
And got (don't worry about the slowness, my system is slow and busy with some
high-priority processes):
Benchmark: timing 100 iterations of join+chr, pack+rand,
pack+rand+srand+ps...
join+chr: 53 wallclock secs (13.16 usr + 0.16 sys = 13.31 CPU)
pack+rand: 16 wallclock secs ( 3.59 usr + 0.03 sys = 3.62 CPU)
pack+rand+srand+ps: 153 wallclock secs ( 3.59 usr 1.70 sys + 4.14 cusr
11.38 csys = 0.00 CPU)
Which means that my previous solution was about 3 times as fast as what was
suggested by Larry. I added a subroutine - just for fun - that also resets
random() by calling some external commands, not surprisingly, this is very,
very slow, approximately 10 times as slow as what I had.
But is there a faster method than my pack+rand?
--
Gerben_Wierda@RnA.nl (Gerben Wierda)
"If you don't know where you're going, any road will take you there"
Paraphrased in Alice in Wonderland, originally from the Talmud.
"Your io is pretty std" -- Larry Wall
------------------------------
Date: Sat, 05 Dec 1998 18:34:13 -0700
From: Tech-No <zerocool@montana.campus.mci.net>
Subject: Finite State Auto..
Message-Id: <3669DF14.7B4@montana.campus.mci.net>
I was wondering if anyone had a Perl script that would test a string to
see if it was a FSA??? If so please email me the source.
Hola
------------------------------
Date: 6 Dec 1998 00:01:49 GMT
From: Robert III Lockhart <D.W.E@worldnet.att.net>
Subject: help, have to figure perl out in 4 days!!
Message-Id: <3669C8AC.C27125EF@worldnet.att.net>
or atleast enough of the Perl language to make a program that takes a
scrambled word and compares it with a word list and prints them both.
It is not a hard concept, basically I can do it in my sleep in C but the
OS class just went to Perl and I'm lost.
I get the concept of using a sub * { thing to make a function, but how
to start a perl file, and play around with several simple learning
programs that play with file manipulation, I am having a hard time
finding examples of code, and a version of perl that will run on a
windows98 version, although I do have a drive that is not yet converted
to FAT32 that I just tried to install perl from using a CD ROM version I
got with a book entitled"Perl by Example", and some of the information
in the Readme files, makes me think I just wasted my time..., not to
mention 40 bucks.
if anyone can give me some quick advice, or sample of code that would
benefit me with this program, then thank you very much,
Rob Lockhart
D.W.E@worldnet.att.net
------------------------------
Date: Sat, 5 Dec 1998 19:46:11 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: help, have to figure perl out in 4 days!!
Message-Id: <1djkx2d.1x760qpcrw1eyN@bos-ip-1-113.ziplink.net>
[posted and mailed]
Robert III Lockhart <D.W.E@worldnet.att.net> wrote:
> if anyone can give me some quick advice...
www.perl.com - Perl distributions, documentation, book reviews, etc.
Learning Perl, 2nd ed, O'Reilly & Associates (the Llama book)
Programming Perl, 2nd ed, O'Reilly & Associates (the Camel book)
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 06 Dec 1998 02:37:02 GMT
From: dturley@pobox.com
Subject: Re: How can I make it impossible to use the browser's back button in a script??
Message-Id: <74cqke$e81$1@nnrp1.dejanews.com>
In article <3668566a.14311871@news.iaehv.nl>,
Rafely@xxiname.com wrote:
> to configure stuff! This could harm the database!! What I want to do
> is make it impossible to return to the menu when a member delete their
> account. How can I do that? Please let me know.
You can't stop the browser's back butoon from working. If users can go back
and "harm" your database there is a serious problem with your database access
script. I suggest you rexamine your programming to see why a user without an
account can affect the database. Before performing any update from the menu,
you should be checking to see if they action is permitted.
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sat, 5 Dec 1998 18:58:13 -0800
From: Katia Hayati <hayati@ocf.Berkeley.EDU>
Subject: Re: How can I make it impossible to use the browser's back button in a script??
Message-Id: <Pine.SOL.3.96.981205185426.13763A-100000@apocalypse.OCF.Berkeley.EDU>
Hi,
I'm no expert but I've given thought to this problem for another
application. What I would do is have that menu in a window without the
toolbar (you can do that with JavaScript), and then capture the Window
events (also with some JavaScript code) to make it impossible for a user
to right click on the window and go back.
Hope that helps (?)
K.H.
On Fri, 4 Dec 1998 Rafely@xxiname.com wrote:
> Hello,
>
> Sorry if the subject was not so clear, but here is what I want to do.
> I have a database with members. When members log in, they will get a
> menu. Using the menu they can edit their account or configure the
> service they receive. Members can also delete their account. When
> someone delete their account, they will get a confirmation screen. But
> they can always use their back button to go back to the menu, and try
> to configure stuff! This could harm the database!! What I want to do
> is make it impossible to return to the menu when a member delete their
> account. How can I do that? Please let me know.
>
> Many Thanks
>
> Rafely
> Rafely@xxiname.com
>
>
------------------------------
Date: 4 Dec 1998 08:45:52 GMT
From: vitus@brass.fe.msk.ru (Victor B Wagner)
Subject: Re: ICQ online pager
Message-Id: <7487g0$sui$4@zware.space.ru>
Eric B (NOSPAMeboo@bigfoot.com) wrote:
: Hi all,
: I need to write a Perl program that will check the icq status of some
: contacts and if they are online, the program will send an email to my
: Telecom and page me. The email part is ok.
: The problem is how do I get the program to check the icq status of my
: friends? This program is going to reside on a server with a permanent
: connection to the Internet.
If your server is LSB-first (i.e. intel or Alpha) machine, running UNIX,
you can have some luck with xtrophy ICQ
client.http://www.xtrophy.dk/xicq/
(It seems that it wasn't updated from July, but anyway)
It is reasonably clean C++ (in fact C with some references to cin/cout
and one functon with reference arg), but hugely byte-order dependent.
It can be converted to perl module if you are good in xs programming,
but I think it is much simplier to just spawn xicq process and interact
with it using IPC::Open2 or Open3.
: Any help or comments will be most welcome.
: Regards,
: Eric.
: PS: To email me, kindly remove NOSPAM from my email address.
--
--------------------------------------------------
Victor Wagner vitus@ice.ru
Programmer Office:7-(095)-964-0380
Institute for Commerce Home: 7-(095)-135-46-61
Engineering http://www.ice.ru/~vitus
------------------------------
Date: Sat, 5 Dec 1998 17:25:45 -0600
From: "Scuttlebutt" <jbailey@cyberconnect.com>
Subject: Re: Installing Win32 Perl (was Re: Seeking Win32::DES.pm)
Message-Id: <74cf2e$ess@enews4.newsguy.com>
Right, I just installed WIN32 in Windows 95 by unzipping the files into the
directory "c:\perl" (clever, eh?). Then I did the following:
1. Ran "perlw32-install.bat" which was in c:\perl\bin
2. Associated files with the ".pl" suffix with perl.exe.
That's it! Now I write Perl scripts in Notepad, save them as ".pl" files,
and just double click on them to run them.
Jonathan Stowe wrote in message <74b8q1$e2$1@gellyfish.btinternet.com>...
>On Fri, 04 Dec 1998 16:32:23 -0800 David L. Painter
<dpainter@lightspeed.net> wrote:
>> Andrew,
>> This is not really in response to your module problem, but I thought
>> that you might know something about how
>> to build/install/configure Perl for Win95. I've
>> downloaded the latest port (5.005) but don't have
>> any clear idea of how to proceed with the installation.
>>
>> Any help, suggestions, or references would help.
>>
>
>You should have downloaded a file called APi506.exe or something like that
>and all it requires is for you to run it. The install program is pretty
>simple but will ask you some questions and just so long as you can give an
>intelligent answer to them then everything should be just swell - infact
>you are probably safe just accepting the defaults for everything. However
>don not be tempted to install into a directory with a space in the name as
>this has been reported to cause problems in some cases.
>
>/J\
>--
>Jonathan Stowe <jns@btinternet.com>
>Some of your questions answered:
><URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
>Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 6 Dec 1998 01:30:20 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Installing Win32 Perl (was Re: Seeking Win32::DES.pm)
Message-Id: <74cmnc$1en$1@gellyfish.btinternet.com>
On Sat, 5 Dec 1998 17:25:45 -0600 Scuttlebutt <jbailey@cyberconnect.com> wrote:
> Right, I just installed WIN32 in Windows 95 by unzipping the files into the
> directory "c:\perl" (clever, eh?). Then I did the following:
>
> 1. Ran "perlw32-install.bat" which was in c:\perl\bin
> 2. Associated files with the ".pl" suffix with perl.exe.
>
I can only suggest that you have downloaded an older version of Perl or that
I should take the 'Ernest Saunders Defence' - the version of Perl that I most
recently installed was an executable install file in the manner of
Installshield. But there you go.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 6 Dec 1998 01:19:28 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Is it possible to run a web server on Win95?
Message-Id: <74cm30$1eh$1@gellyfish.btinternet.com>
comp.lang.perl does not exist anymore - if your ISP thinks that it does then
jack them in if your news client doesnt warn about its non existence query the
behaviour of your news client.
In comp.lang.perl.misc Woofy <chrisWoofy@epix.net> wrote:
> I think there are 2 kinds of PWS.
>
> One that is included with Frontpage and one that is called, "Microsoft
> Personal Web Server" that you can download (I think) from the
> Microsoft site.
>
> There are differences between the 2.
>
> Can't remember what those differences are.
>
Er I think what you mean to say is that the one that comes with frontpage is
Personal Webserver version 2 (perhaps 3) that is based on IIS 3.0 and the
current version of PWS which is based on IIS 4.0 . However none of this has
much to do with Perl and I think that you probably want to take this to
another group.
> That's what happends when you keep shiftng from VB to Access to HTML
> to Javascript to C to Corel Draw to Acrobat to Frontpage and now to
> Perl.
>
I'd go back to freebasing quite honestly.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 6 Dec 1998 02:06:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Is Tcl/Tk better than Perl ?
Message-Id: <74cora$1f4$1@gellyfish.btinternet.com>
On Sat, 5 Dec 1998 22:54:26 +0100 Patrick Fichou <fichou@clubintnet.fr> wrote:
> Hi to you all,
>
> I woul *really* know what you think of Tcl/Tk ! I mean, do I have to learn
> Perl instead of Tcl ? Is Perl somewhat out of date ?
> Is it a correct choice I do if I choose Tcl ? ...and so on !
>
>
Yeah, you really asked that question in the right newsgroup didnt you ;-P
To this eye Tcl is ugly, complicated and inflexible but thats me and I really
did give it a try but it just didnt grab me just like Python ans so on.
Tk on the other hand is basically just a library that allows one to
introduce event and graphic oriented stuff into your programs. Perl/Tk is
at the very least fun to program and will enable you to create gui programs
with Perl.
Perl is by the way not out of date - it is constantly in development and is
supported by some of the best minds in the business (I wouldnt include myself
amongst them by the way - <best minds not supporters of Perl>).
Learn Perl, not Tcl...
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 05 Dec 1998 21:56:11 -0500
From: alan san juan <kalim@erols.com>
Subject: Re: java servlets vs imbedded mod_perl for servers
Message-Id: <3669F24B.5115@erols.com>
I think you misunderstand. The guy is asking about servlets (server-side
java) vs cgi, so of course the server side servlets do not have the
security restrictions imposed on applets.
as far as i know, servlets have a lot of advantages over cgi.
here are some references (pardon because i know this is a perl ng):
http://www.servletcentral.com/1998-08/choice.dchtml
http://www.servlets.com/resources/urls/articles.html
Erik wrote:
> This is not a valid question. Java and Perl are languages built on two
> totally separate concepts for two totally separate uses. Java is designed
> for machine independence, and due to its self-imposed security
> restrictions (which are a good thing), it cannot hope to do many of the
> things you would like to do in a CGI script, which can be done
> in perl (writing a file on the server, for example). Java, on the
> other hand, is good at writing real-time games and pretty animations
> that run on the client side, thus freeing up the server, but is generally
> useless for things such as data collection.
> Which one of these is best for you really depends on what you're
> trying to accomplish.
>
> --
> Erik Nielsen, Cyberhighway Internet Services NOC
> Sometimes we choose the generalization. Sometimes we don't.
> -- Larry Wall in <199709032332.QAA21669@wall.org>
------------------------------
Date: Sun, 6 Dec 1998 02:36:02 -0000
From: "Bruce Davidson" <group95@allied.demon.co.uk>
Subject: Re: Merge Files
Message-Id: <912911538.21362.0.nnrp-07.9e982204@news.demon.co.uk>
Thanks for all e-mail replies - have it sorted now.
------------------------------
Date: Sat, 05 Dec 1998 14:53:26 -0800
From: cheese4@hotmail.com (RemarQ User)
Subject: Re: newbie file open question
Message-Id: <RRia2.785$45.1203120@WReNphoon1>
> I can't find a description of how strings are
> converted to numbers in either %22Programming Perl%22
> nor in the PODs for 5.00502. Is that a bug in the
> documentation, or am I just not searching for the
> right words?
>
> I thought is said somewhere that perl uses C's
> atoi() for converting strings to numbers, but I
> cannot find anywhere that says that now either...
Page 38, footnote #4 of Programming Perl, 2nd Ed.
--An Ultra Newbie =)
-**** Posted from remarQ, Discussions Start Here(tm) ****-
http://www.remarq.com/ - Host to the the World's Discussions & Usenet
------------------------------
Date: 6 Dec 1998 01:23:22 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Please Help where can i download perl -
Message-Id: <74cmaa$1ek$1@gellyfish.btinternet.com>
On Sat, 05 Dec 1998 22:13:25 GMT Woofy <chrisWoofy@epix.net> wrote:
> On Tue, 24 Nov 1998 01:19:20 GMT, alastair@calliope.demon.co.uk
> (Alastair) wrote:
>
>>>>MarcoPolo <nic_azzuri@compuserve.com> wrote:
>>>>>I am new to perl and am trying to locate it to install onto a sparc 10
>>>>>any answers would be excellent
>>>>>
>>>>>Please Help where can i download perl
>>>>
>>>>Many years of internet experience have honed my search skills to a remarkable
>>>>level and I suggest trying ;
>>>>
>>>>http://www.perl.com
>>>>or
>>>>http://www.perl.org
>>>>
>>>>Who'd have thought?
>>>>
>>>>--
>>>>
>>>>Alastair
>
>
> As in Alastair Sim?
>
> You know, Scrooge.
>
>
I really would stick to the crack if I were you - you dont seem to got the
hang of this usenet thing yet.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 6 Dec 1998 02:40:33 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Question: Ms IIS WWW server releasing resources used by Perl
Message-Id: <74cqr1$1f8$1@gellyfish.btinternet.com>
On Fri, 04 Dec 1998 01:26:50 GMT Martien Verbruggen <mgjv@comdyn.com.au> wrote:
> In article <01be1fe6$f68e1b80$535b9cd1@03q04sia>,
> "David Fulton" <DFULTON@prodigy.net> writes:
>
>> Myself and my network administrator are having on ongoing debate
>> about the efficiency of using Perl as a CGI scripting language. His
>> argument is this:
>>
>> My Perl script instances are slowly clogging up the NT server (and
>> are not released) slowly bringing the server to its knees.
>
> This may not be a problem with perl, but with the web server software,
> and the 'OS'. NT is bad at this sort of stuff. NT is reliably
> unstable.
>
>> My question is are there ways (within my simple Perl scripts) to
>> complete a program ensuring that the WWW server can release
>> resources, or is the network adminstrator fated to a) have to reboot
>> the web-server every couple of weeks or b) persuade my boss to dump
>> Perl as a programming language altogether?
>
> He will have to reboot regularly, or change OS. I have seen various
> unixes run without system degradation for over a year (Solaris,
> Ultrix, Linux). I have seen one occurrence of a heavily loaded
> database server on Solaris, running for 500 days, at which time it
> needed to be rebooted because of an OS upgrade. I have seen heavily
> loaded web servers up for over a year, on Solaris.
>
> I still have to see the first NT server that has been running under
> reasonable load for more than a month. I still have to hear about it.
>
I would concur with this entirely I have a Linux machine running at work
which was once the first Novell Server that the Council ever had and
started to become unreliable for that purpose however it now runs DNS,
HTTP and mail services and here we are talking a very old 486sx25. I have
an NT server - some meganutterbastard box that runs a bit of Proxy server
and a spot of mailtransfer and that often needs to be reloaded more than once
a day. On the other hand I also have a bunch of Sun Enterprise ultras that
do Oracle and they need reloading all the time ...
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 6 Dec 1998 00:15:47 GMT
From: nina2@blue.seas.upenn.edu (Nina Hung)
Subject: simple question about the submit button
Message-Id: <74cibj$mc1$1@netnews.upenn.edu>
Inputs : Jan - Dec
Click on submit button : get input , process a perl script and give output...
INSTEAD of using the submit button, is it possible just to click on one
of the 12 month images ,and have the perl script run and recognize the
input month?
Thank you!
Nina
------------------------------
Date: Sat, 5 Dec 1998 19:29:57 -0600
From: "Kenner" <kennerPIDDLE@xnet.com>
Subject: Re: simple question about the submit button
Message-Id: <74cmm2$f7n$1@flood.xnet.com>
Presuming you're talking about using this in a web page, one way might be to
make each month image a link with the targeted URL being the address for
your cgi script plus the parameters for that specific month.
--
XOXO,
Kenner
(remove the word "PIDDLE" from my address to send me e-mail.)
------------------------------
Date: 6 Dec 1998 01:44:04 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: simple question about the submit button
Message-Id: <74cnh4$1er$1@gellyfish.btinternet.com>
On 6 Dec 1998 00:15:47 GMT Nina Hung <nina2@blue.seas.upenn.edu> wrote:
> Inputs : Jan - Dec
>
> Click on submit button : get input , process a perl script and give output...
>
> INSTEAD of using the submit button, is it possible just to click on one
> of the 12 month images ,and have the perl script run and recognize the
> input month?
>
Er yes but you'd probably want to ask in a more appropriate group to get a
more complete answer.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 05 Dec 1998 22:00:28 -0500
From: alan san juan <kalim@erols.com>
Subject: Re: simple question about the submit button
Message-Id: <3669F34C.43F@erols.com>
This is not the appropriate ng. However, you can use javascript to do
this very easily. on the h ref tag put in onClick="someFunction(month
name)" which calls a function that then points to the appropriate cgi
using post or get
alan.
Nina Hung wrote:
>
> Inputs : Jan - Dec
>
> Click on submit button : get input , process a perl script and give output...
>
> INSTEAD of using the submit button, is it possible just to click on one
> of the 12 month images ,and have the perl script run and recognize the
> input month?
>
> Thank you!
>
> Nina
------------------------------
Date: Sat, 05 Dec 1998 23:09:32 GMT
From: juergen@monocerus.demon.co.uk (Juergen Heinzl)
Subject: Re: Some questions
Message-Id: <slrn76jf0h.h4.juergen@monocerus.demon.co.uk>
In article <3669B9D1.7E194393@shaw.wave.ca>, Rick Delaney wrote:
>[posted & mailed]
>
>Juergen Heinzl wrote:
>>
>> In article <74c5ue$92d$1@reader3.wxs.nl>, Martin wrote:
>> [...]
>> >for (0..$#lines) {
>> > @lines[$_] =~ s/$something/$something_else/gi;
>> >}
>> You might use map ...
>> map {
>> s/$_/blablabla/;
>> } @lines;
>
>Except then you would be using the yucky 'map in a void context'. Plus
>I don't think your code is doing what you think it is. What you have
>written is equivalent to:
>
> map { $_ = 'blablabla' } @lines;
Oops ... yup, it's late ... s/foo/blablabla/; ... I've got no problems
with the void context though since it does not make much sense to use
@lines = map { ... } here.
[...]
Cheers,
Juergen
--
\ Real name : J|rgen Heinzl \ no flames /
\ EMail Private : juergen@monocerus.demon.co.uk \ send money instead /
\ Phone Private : +44 181-332 0750 \ /
------------------------------
Date: Sun, 6 Dec 1998 01:13:20 +0100
From: "Martin" <markrame@hotmail.com>
Subject: Re: Some questions
Message-Id: <74ci74$m9g$1@reader2.wxs.nl>
Sean McAfee wrote in message <gmha2.201$4w2.1064616@news.itd.umich.edu>...
>In article <74c5ue$92d$1@reader3.wxs.nl>, Martin <markrame@hotmail.com>
wrote:
>>I have three questions. I am rather new at this, so please forgive my
>>ignorance.
>
>>1): If I have an array, say @lines, and I wish to do a search and replace
on
>>each element, then is there a better way to do this than like this?
>
>>for (0..$#lines) {
>> @lines[$_] =~ s/$something/$something_else/gi;
>>}
>
>TMTOWTDI, of course, but I think this is better:
>
>foreach $line (@lines) {
> $line =~ s/$something/$something_else/gi;
>}
>If you're using Perl 5.005 you can shorten it still further:
>
>s/$something/$something_else/gi foreach @lines;
Well, thank you Sean for the info; but here is where my limited knowledge
wreaks havoc on my mind. :) You see, the way I understood it,
$line =~ s/$something/$something_else/gi;
will only make the substitutions in $line, whereas
@lines[$_] =~ s/$something/$something_else/gi;
will change the actual content of the array-element. That is why I forwent
the use of "while" or "foreach", so "for (0..$#lines)" would yield a counter
to be used for indexing the array. If this all sounds frightfully dumb to
you, then I am truly sorry, but I guess I just fail to get it.
Thanks,
Martin
------------------------------
Date: 6 Dec 1998 00:20:19 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Some questions
Message-Id: <slrn76jje3.ga4.sholden@pgrad.cs.usyd.edu.au>
On Sun, 6 Dec 1998 01:13:20 +0100, Martin <markrame@hotmail.com> wrote:
>Sean McAfee wrote in message <gmha2.201$4w2.1064616@news.itd.umich.edu>...
>
>>In article <74c5ue$92d$1@reader3.wxs.nl>, Martin <markrame@hotmail.com>
>wrote:
>>>I have three questions. I am rather new at this, so please forgive my
>>>ignorance.
>>
>>>1): If I have an array, say @lines, and I wish to do a search and replace
>on
>>>each element, then is there a better way to do this than like this?
>>
>>>for (0..$#lines) {
>>> @lines[$_] =~ s/$something/$something_else/gi;
>>>}
>>
>>TMTOWTDI, of course, but I think this is better:
>>
>>foreach $line (@lines) {
>> $line =~ s/$something/$something_else/gi;
>>}
>>If you're using Perl 5.005 you can shorten it still further:
>>
>>s/$something/$something_else/gi foreach @lines;
>
>Well, thank you Sean for the info; but here is where my limited knowledge
>wreaks havoc on my mind. :) You see, the way I understood it,
>
>$line =~ s/$something/$something_else/gi;
>
>will only make the substitutions in $line, whereas
For the perlsyn documentation ('perldoc perlsyn') :
The foreach modifier is an iterator: For each value in EXPR, it
aliases $_ to the value and executes the statement.
In other words inside the foreach loop modifying the iterator variable
($_ by default, $Line above) will actually modify the original array.
This makes foreach much much much more useful, but can be a 'gotcha' if
you don't realise it is happening and are using side effects when you
shouldn't.
>@lines[$_] =~ s/$something/$something_else/gi;
I think you mean $lines[$_]...
--
Sam
compiling kernels is what I do most, so they do tend to stick to the
cache ;) --Linus Torvalds
------------------------------
Date: Sat, 5 Dec 1998 19:46:12 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Some questions
Message-Id: <1djkxdo.m2uxs629wtw9N@bos-ip-1-113.ziplink.net>
Rick Delaney <rick.delaney@shaw.wave.ca> wrote:
> > map {
> > s/$_/blablabla/;
> > } @lines;
> What you have written is equivalent to:
>
> map { $_ = 'blablabla' } @lines;
Not if $_ contains regex metacharacters.
Or, even worse, no characters at all.
;-)
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sat, 5 Dec 1998 15:23:05 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: the Unix epoch is not the beginning of time (was Re: localtime () - perl's bug ?)
Message-Id: <19981205.152305.0g0.rnr.w164w@locutus.ofB.ORG>
lr@hpl.hp.com (Larry Rosler) writes:
> [Posted to comp.lang.perl.misc and copy mailed.]
you can stop mailing me your pointless comments; I don't mind when
people in general do, but you should stop -- wasting the bandwidth
once by posting it is bad enough.
>> > The function presented is accurate (and, IMO, trivial).
>>
>> yes. it _was_ trivial.
>>
>> didn't that strike you as odd? that there was a trivial solution to
>> this problem that many people are concerned about?
>>
>> did you think that perhaps you weren't solving the right problem?
>
> The problem I was solving is a very real one.
how is `real' comparable to `right'?
of course it's a real problem. people post code every week that will
return a year of 100 in a few months.
but it's not the right problem, the one that's causing all the concern,
the one that is nontrivial.
> Let me try again with more words, for the dimmer bulb that you seem to be.
hee hee! what do I have to do for you to insult my family?
> Demanding that all programs *shall* produce four-digit years is inane.
and yet right after that you say
> Sound engineering practice, especially for web programming, requires
> that one's programs produce output that conforms strictly to standards,
oops, I feel an insult to my family coming on!
those stupid 4-digit-year people -- how dare they only solve 99.9% of
the problem, when your code already solves 75% of the problem?
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Sat, 5 Dec 1998 15:28:23 -0500
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: the Unix epoch is not the beginning of time (was Re: localtime () - perl's bug ?)
Message-Id: <19981205.152823.6U0.rnr.w164w@locutus.ofB.ORG>
fl_aggie@thepentagon.com (I R A Aggie) writes:
> 0 according to the Hebrew reckoning isn't the beginning of time.
> 0 according to the Mayan reckoning isn't the beginning of time.
> 0 according to the Celtic reckoning isn't the beginning of time.
> 0 according to the astronomer's reckoning isn't the beginning of time.
all of these are true, and for the overwhelmingly vast majority of
common use, only trivially so.
for `beginning of time' in my Subject: substitute `beginning of
relevant time for the overwhelmingly vast majority of common use'.
who has not dealt with code that deals with dates in the past (e.g.,
birthdates) and the future (e.g., scheduling)?
for the OVM, all of these references fit well within the 4-digit AD
system of reckoning.
this is not true of the Unix epoch system.
for a tiny fraction, using the H/M/C/astronomer reckoning may be
required (or having a flag indicating BC, which I think could well
be a worse idea).
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Sun, 06 Dec 1998 00:27:38 GMT
From: bhoylma@uswest.com
Subject: Re: using exec cmd
Message-Id: <74cj1p$86g$1@nnrp1.dejanews.com>
In article <74ak5a$hrm$1@sparky.wolfe.net>,
pinoy@w-link.net (geekman) wrote:
> Cheers:
> does anyone know if it's possible to use <!--#exec cmd --> in a perl
> script.. I've used the \ esc char to make the script read this line.
> but no ouput from the cmd.. any help appredicated
>
This looks suspiciously like html. Particularly, SSI. Perhaps one of the web
groups would be able to help you configure your server properly to execute SSI
commends.
Peace.
--
Bruce W. Hoylman (303-541-6557) -- bhoylma@uswest.com ._ 0
- __0 "I intend to live forever... /\/\ /\ / //\.
- - - _-\<,_ so far, so good." /~/~~\/\/~~\ ' \>> |
- __(_)/_(_)_____________________________/\ / \ \/\ \________\\ `_
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4366
**************************************