[9271] in Perl-Users-Digest
Perl-Users Digest, Issue: 2866 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 13 17:07:25 1998
Date: Sat, 13 Jun 98 14:00:24 -0700
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, 13 Jun 1998 Volume: 8 Number: 2866
Today's topics:
Re: $a: numeric or NOT ? <bowlin@sirius.com>
[Q] Help creating a perl cgi script - word1.txt [1/1] (anonymous)
Re: [Q] Help creating a perl cgi script - word1.txt [ (Bob Trieger)
Re: [Q] Help creating a perl cgi script - word1.txt [ (anonymous)
Re: diff-like utility in Perl? <pvhp@forte.com>
Re: diff-like utility in Perl? (Jonathan Stowe)
Re: ending a foreach loop <aqumsieh@matrox.com>
Re: Have we got a good free Perl manual? birgitt@my-dejanews.com
Re: Have we got a good free Perl manual? (Leslie Mikesell)
Re: Is this insane? (Bbirthisel)
Re: Mailing checkbox info from form with perl cgi - hel (Jonathan Stowe)
Re: new to this - simple if statement question (Florian Kuehnert)
Re: new to this - simple if statement question (Greg Andrews)
Re: perl and NT Registrary access (Jonathan Stowe)
Re: perl and NT Registrary access <pvhp@forte.com>
Re: perl and NT Registrary access (Andy Lester)
Re: perl and recursion? <aqumsieh@matrox.com>
Perl editor debugger <p-lanphier@psu.edu>
Re: Perl editor debugger (Jonathan Stowe)
Re: Perl editor debugger (Bob Trieger)
Problems with <*> or <*.*> <rotondo@bluewin.ch>
Re: Problems with installing perl in win 95 .... (Jonathan Stowe)
Re: Return values of comparison operators (Michael Rubenstein)
Re: REVIEW: Perl CGI Programming - No Experience Requir <tchrist@mox.perl.com>
Re: Rounding Numbers (Florian Kuehnert)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 13 Jun 1998 10:05:04 -0700
From: Jim Bowlin <bowlin@sirius.com>
Subject: Re: $a: numeric or NOT ?
Message-Id: <3582B140.612C4369@sirius.com>
Jim Bowlin wrote:
>
> Michael D. Schleif wrote:
> >
> > I've been struggling with this, off and on, for quite some time: what is
> > the most efficient way to test whether or not a variable is numeric, and
> > therefore subject to numeric calculations without complaining about "-w"
> > and "use strict?"
> I would try
>
> sub is_num {
> $_[0] =~ m/^\s*[\+\-]?(\d+.?\d*|\.\d+)(e[\+\-]?\d+)?$/i ? 1 : 0;
^
typo
> }
>
$_[0] =~ m/^\s*[\+\-]?(\d+\.?\d*|\.\d+)(e[\+\-]?\d+)?$/i ? 1 : 0;
^
added a backslash.
-- Jim Bowlin
------------------------------
Date: 13 Jun 1998 18:50:04 GMT
From: anonymous@nouce.net (anonymous)
Subject: [Q] Help creating a perl cgi script - word1.txt [1/1]
Message-Id: <6luhks$gbk$1@owl.slip.net>
Hello,
I like to know if someone might be able to help me write a simple perl cgi script
that when a person goes to a pull down menu he/she will be able to have 5 choses from
view today messages, past 1 day, past 2 day, past 3 day and past 4 day and then after
clickin on the view recent messages the files will be pulled up for viewing.
Additional information that might help that this is a message board and most of the post
include the date and time. See below
<ul>
<!--begin-->
<!--top: 510--><li><a href="messages/510.html"><b>Test</b></a> - Mary <i>08:46:49 5/31/98</i>
(<!--responses: 510-->0)
<ul><!--insert: 510-->
</ul><!--end: 510-->
The html tags:
<FORM METHOD=POST ACTION="newscript.cgi">
<b>View Recent Messages Posted:</B><br>
<SELECT NAME="stime"><OPTION SELECTED VALUE=0>Today Messages<OPTION VALUE=1>Past 1 Day<OPTION VALUE=2>Past 2 Days<OPTION VALUE=3>Past 3 Days<OPTION VALUE=4>Past 4 Days
</SELECT><INPUT TYPE=SUBMIT NAME=action VALUE="View Recent Messages!"></FORM>
Any help or suggestions would be appreciated
------------------------------
Date: Sat, 13 Jun 1998 19:15:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: [Q] Help creating a perl cgi script - word1.txt [1/1]
Message-Id: <6luj87$dbs$1@strato.ultra.net>
anonymous@nouce.net (anonymous) wrote:
-> Hello,
-> I like to know if someone might be able to help me write a simple perl
-> cgi script
-> that when a person goes to a pull down menu he/she will be able to have 5
-> choses from
-> view today messages, past 1 day, past 2 day, past 3 day and past 4 day and
-> then after
-> clickin on the view recent messages the files will be pulled up for viewing.
-> Additional information that might help that this is a message board and
-> most of the post
-> include the date and time. See below
<<-- Matt Wright's wwwboard HTML deleted -->>
How much of "YOUR" script have you got written and working and what part of
"YOUR" script are you having problems with?
Post the snippet of "YOUR" script that the problems are ocurring.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: 13 Jun 1998 19:35:02 GMT
From: anonymous@nouce.net (anonymous)
Subject: Re: [Q] Help creating a perl cgi script - word1.txt [1/1]
Message-Id: <6luk96$qbn$1@owl.slip.net>
In article <6luj87$dbs$1@strato.ultra.net>, sowmaster@juicepigs.com (Bob Trieger) says:
>
>anonymous@nouce.net (anonymous) wrote:
>-> Hello,
>-> I like to know if someone might be able to help me write a simple perl
>-> cgi script
>-> that when a person goes to a pull down menu he/she will be able to have 5
>-> choses from
>-> view today messages, past 1 day, past 2 day, past 3 day and past 4 day and
>-> then after
>-> clickin on the view recent messages the files will be pulled up for viewing.
>-> Additional information that might help that this is a message board and
>-> most of the post
>-> include the date and time. See below
>
><<-- Matt Wright's wwwboard HTML deleted -->>
>
>How much of "YOUR" script have you got written and working and what part of
>"YOUR" script are you having problems with?
>
>Post the snippet of "YOUR" script that the problems are ocurring.
>
>
>Bob Trieger
>sowmaster@juicepigs.com
>" Cost a spammer some cash: Call 1-800-239-0341
> and hang up when the recording starts. "
Thanks for your fast responds. I have not started this at all since I am
not a expert in perl. I was wondering if someone might be able to write
one so I can learn from that.
------------------------------
Date: Sat, 13 Jun 1998 11:10:35 -0700
From: Peter Prymmer <pvhp@forte.com>
Subject: Re: diff-like utility in Perl?
Message-Id: <3582C09B.41ED@forte.com>
Lloyd Zusman wrote:
>
> Tom Christiansen <tchrist@mox.perl.com> writes:
>
> > [courtesy cc of this posting sent to cited author via email]
> >
> > In comp.lang.perl.misc,
> > Lloyd Zusman <ljz@asfast.com> writes:
> > :I know of no such Perl-based `diff', but perhaps someone out there has
> > :invented such a thing without having posted it to CPAN.
> >
> > Is there a Perl-based netstat? Or ps? Or vi?
>
> Probably not, but there is a Perl-based `find', a Perl-based `grep', a
> Perl-based `tail', a Perl-based `whois', a Perl-based `lex', a
> Perl-based `telnet', a Perl-based `ftp', a Perl-based `mv', a
> Perl-based `cp', a Perl-based `rm' ... etc. ...
There is the toyedit editor with Perl/Tk. I would not even hint that
it is anywhere near vi, but there is a visual editor written in Perl.
The File::Cmp module could be the start of a File::Diff provided only
that it is outfitted with diff algorithms rather than simple
C<if ($string1 ne $string2)> stuff.
Peter Prymmer
------------------------------
Date: Sat, 13 Jun 1998 20:16:31 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: diff-like utility in Perl?
Message-Id: <3582cb81.16902674@news.btinternet.com>
On 12 Jun 1998 19:25:19 -0400, Lloyd Zusman wrote :
>Gellyfish@btinternet.com (Jonathan Stowe) writes:
>
>> On 12 Jun 1998 12:33:08 GMT, Joe Foose wrote :
>>
>> >Does anybody know if there is a Perl function which compares two files or
>> >strings and returns output similar to Unix's diff command?
>> >
>>
>> Why when we all have diff
>
>Why `File::Find' when we all have `find'?
>
>Why `File::Copy' when we all have `cp' and `mv'?
>
>... etc. ...
>
>I'm not suggesting that someone go out and invent `File::Diff' or
>`String::Diff' or whatever it might be called. Rather, I'm contending
>that it's quite reasonable that someone might be interested in
>investigating the possible existence of such a module given that
>`File::Find', `File::Copy', and a number of other Perl-based
>enhancements/replacements for traditional Unix functions have already
>been created.
>
>The `diff' program itself is not trivial to write, since the
>algorithms it uses can be tricky. Therefore, writing a Perl
>implementation of this would be very instructive and interesting for
>anyone willing to undertake that task. I might even do it myself if I
>manage to find a sufficient amount of spare time before the millenium
>ends ... <not holding breath>
>
I must admit that I took the original posters question to mean whether
it was possible to fulfill a lack of "diff" on the Windows platform
with something written in Perl - which is of course unnecessary.
However I do agree with you that a Perl implementation of "diff" would
be an interesting proposition.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 13 Jun 1998 15:17:36 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: ending a foreach loop
Message-Id: <3582D050.C59220E7@matrox.com>
Kevin Thorley wrote:
> I'm using the following lines of code to search an array line by line
> for a given string. When I find the string though, I don't want to
> continue searchin (it will only appear once). Can I break out of a
> foreach loop, or should I be using another type of loop.
>
> foreach (@DATA){
> if (! m/^\#/) {
> if (m/^$file_name/){
> split(/\t+/);
> }
> }
>
> Kevin Thorley
> kthorley@mpgnews.com
You should use "last" ... Read some documentation.
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Sat, 13 Jun 1998 19:05:28 GMT
From: birgitt@my-dejanews.com
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6luihn$vak$1@nnrp1.dejanews.com>
In article <RJcg1.111$Fr5.1316181@cam-news-reader1.bbnplanet.com>,
Barry Margolin <barmar@bbnplanet.com> wrote:
>
> In article <8H4g1.874$bj2.4289526@ptah.visi.com>,
> Todd Lehman <lehman@visi.com> wrote:
> >
> >rms@gnu.org (Richard Stallman) writes:
> >> Once upon a time, I thought I would learn Perl. I got a copy of a
> >> free manual, but I found it simply unreadable, and gave up. Perl
> >> users told me that there were better manuals, but they were not free.
> >
> >It seems odd to deny oneself the pleasure of learning a new language for
> >several years simply because someone tells you that the best documentation
> >isn't freely available.
> >
> >Was the decision a personal monetary issue or a moral issue?
> >
> >For serious work, a Perl library of about 10 good titles costs around $300.
> >But you can get started for a small investment of $30 or $40, depending on
> >which book you choose. Alternatively, perhaps a friend or relative could buy
> >you _Programming_Perl_ or _Learning_Perl_ as a gift.
>
> What does money have to do with this discussion? If you've read this
> thread, you should know that when RMS says "free" he refers to freedom to
> share and modify, not price.
>
> For RMS, it's clearly a moral issue. He considers himself a vanguard of
> the free software movement, and insists on using free software as much as
> feasible. When he needs software for a task and can't find a free version,
> he writes it himself or encourages others to do so.
>
And why are these FSF style free manuals not written then ? Not a
money issue ? Are all documentation writers going to be martyrs
for the FSF ? Or are they allowed to be modestly recompensated
for their work.
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 13 Jun 1998 14:56:05 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6lulgl$kml$1@Mercury.mcs.net>
In article <6luihn$vak$1@nnrp1.dejanews.com>, <birgitt@my-dejanews.com> wrote:
>In article <RJcg1.111$Fr5.1316181@cam-news-reader1.bbnplanet.com>,
>> For RMS, it's clearly a moral issue. He considers himself a vanguard of
>> the free software movement, and insists on using free software as much as
>> feasible. When he needs software for a task and can't find a free version,
>> he writes it himself or encourages others to do so.
>>
>
>And why are these FSF style free manuals not written then ? Not a
>money issue ? Are all documentation writers going to be martyrs
>for the FSF ? Or are they allowed to be modestly recompensated
>for their work.
With free software/documention, things don't exist until someone wants
to do it for free or manages to obtain funding by other-than-normal
means. There is nothing wrong with maintaining a list of things that
are desired/needed. You just have to realize that they may never be
done and unlike the normal customer/vendor relationship the number
of people who need something has absolutely no influence on whether
it will be done.
Les Mikesell
les@mcs.com
------------------------------
Date: 13 Jun 1998 19:48:05 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Is this insane?
Message-Id: <1998061319480500.PAA26787@ladder03.news.aol.com>
Hi Steve:
>> Install Perl for NT.
>> You won't regret it.
>>
>> And, no, I'm not being facetious. In the 10 hours you've spent, you
>> could have a working NT Perl talking to IIS and running CGI's.
Correct answer.
>I don't doubt it but what I forgot to make clear in my original post was
>that I don't have access to the NT machine :(
>
>The situation is that I'm working for a web development company and a client
>has requested the scripts be installed in his account on an ISP that's
>running NT with IIS 4.0 and nothing else. To make things even more
>difficult the ISP isn't even in the same country as us.
And you expect this ISP to allow you to install a one-of-a-kind executable
with the capability of an embedded perl and minimal prospects of support
if something goes wrong???
> At this point I'm
>about ready to tell my boss that it's not going to be worth the time and
>trouble to support this woeful environment but I thought I'd see if anyone
>has any suggestions first.
Another correct answer (unless you take the first one). At least you picked
the appropriate subject line.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Sat, 13 Jun 1998 20:16:33 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Mailing checkbox info from form with perl cgi - help!!!
Message-Id: <3582d24d.18642588@news.btinternet.com>
On Fri, 12 Jun 1998 11:34:38 +0100, Tim Swallow wrote :
>Hi,
>
>I've just started to look at using Perl CGI scripts on my web page to mail
>the contents of a form back to me.
>
<snip>
Eh,oh
>@pairs = split(/&/, $buffer);
>
>foreach $pair (@pairs)
>{
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> print "Setting $name to $value<P>";
>
> $FORM{$name} = $value;
>}
>.
It looks like you're on the verge of inventing your own wheel here.
If you use CGI.pm you can handle these kinds of things in a well
documented and consistent manner.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 13 Jun 1998 18:35:04 GMT
From: sutok@gmx.de (Florian Kuehnert)
Subject: Re: new to this - simple if statement question
Message-Id: <slrn6o5hio.uou.sutok@babelon.in-brb.de>
Kerrie Etter schrieb/wrote/icrivait/ha scritto:
>sorry this is probably a horribly simple question but.....
"I did not read the documentation and the FAQs".
>if ($state == California) {
s/==/eq/
"eq" compares strings, "==" tries to compare the numerical values of them.
Florian
--
"Warum kostet Linux nichts?
Warum gibt es kein einheitliches Frontend?"
-- aus "Wie starte ich einen Endlos-Thread?", Teil 1327
(Holger Schauer in dcolm)
------------------------------
Date: 13 Jun 1998 20:49:00 GMT
From: gerg@shell. (Greg Andrews)
Subject: Re: new to this - simple if statement question
Message-Id: <6luojs$7ut$1@news.ncal.verio.com>
sutok@gmx.de (Florian Kuehnert) writes:
>Kerrie Etter schrieb/wrote/icrivait/ha scritto:
>>sorry this is probably a horribly simple question but.....
>
>"I did not read the documentation and the FAQs".
>
>>if ($state == California) {
>
>s/==/eq/
>
>"eq" compares strings, "==" tries to compare the numerical values of them.
>
Most of the respondents also seem to have overlooked that the
strings being compared against are barewords instead of being
quoted.
...Or did I overlook that that's not a problem?
-Greg
------------------------------
Date: Sat, 13 Jun 1998 18:16:39 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: perl and NT Registrary access
Message-Id: <3582bc98.13321948@news.btinternet.com>
On Fri, 12 Jun 98 20:47:15 GMT, Jahan K. Jamshidi wrote :
>I need to run a perl script to gather information about the NT status and its
>registery values. Does anybody know how to access the registery values from
>perl. I don't need to change any value, just read them and save them for
>later diagnostics.
>
You could try looking at:
http://reference.perl.com/query.cgi?windows
There is Win32:: module that does deal with registry stuff but I cant
remember what it is right now.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 13 Jun 1998 11:24:33 -0700
From: Peter Prymmer <pvhp@forte.com>
To: Fred Yip <YipMeister@speegle.com>, JahanJ@yahoo.com
Subject: Re: perl and NT Registrary access
Message-Id: <3582C3E1.4798@forte.com>
Fred Yip wrote:
>
> In article <6ls48c$gho@rap.SanDiegoCA.NCR.COM>, JahanJ@yahoo.com (Jahan K. Jamshidi) wrote:
> >I need to run a perl script to gather information about the NT status and its
> >registery values. Does anybody know how to access the registery values from
> >perl. I don't need to change any value, just read them and save them for
> >later diagnostics.
> >
> >Thankx in advance. Please send your responses to
> >Jahan@pricecut.com
> >
> > - J
You will probably want the Win32::Registry module(s) that come(s) with
the Standard Port of Perl to NT/95.
I do not know who wrote it but whoever it was did not believe in pod at
the time so you'll have to piece together how to use it from other Win32
Perl specific documentation. The module itself was installed in
C:\PERL\LIB\site\WIN32>Registry.pm on an NT system that I checked.
Peter Prymmer
------------------------------
Date: 13 Jun 1998 15:49:58 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: perl and NT Registrary access
Message-Id: <6lu736$6ca$1@supernews.com>
: >I need to run a perl script to gather information about the NT status and its
: >registery values. Does anybody know how to access the registery values from
: >perl. I don't need to change any value, just read them and save them for
: >later diagnostics.
I just posted some code here last week that does a search-and-replace on
Registry values. Look for a subject line that starts "CODE:".
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: Sat, 13 Jun 1998 15:08:49 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: perl and recursion?
Message-Id: <3582CE41.FB38CA0C@matrox.com>
Michael Wentzel wrote:
> Does perl allow recursion? In other words, does this work?
>
> sub update_totals
> { ...
> if ($filename ne "") { &update_totals; }
> ...
> }
>
> If anyone can help me with this or point me in the right direction I
> would appreciate it. Thanks.
Why don't you try and see? Why don't you read the FAQs?
>From perlsub:
Subroutines may be called recursively. If a subroutine is
called using the "&" form, the argument list is optional,
and if omitted, no @_ array is set up for the subroutine:
the @_ array at the time of the call is visible to
subroutine instead. This is an efficiency mechanism that
new users may wish to avoid.
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Sat, 13 Jun 1998 14:09:16 -0400
From: "Patrick Lanphier" <p-lanphier@psu.edu>
Subject: Perl editor debugger
Message-Id: <6lufel$17me@r02n01.cac.psu.edu>
Keywords: editor debugger perl
What would you say is the best Perl editor/debugger available is
commercially or free for Windows NT?
Patrick Lanphier
Applied Research Laboratory
The Pennsylvania State University
------------------------------
Date: Sat, 13 Jun 1998 18:46:25 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl editor debugger
Message-Id: <3582c67c.15667905@news.btinternet.com>
On Sat, 13 Jun 1998 14:09:16 -0400, Patrick Lanphier wrote :
>What would you say is the best Perl editor/debugger available is
>commercially or free for Windows NT?
>
I personally use Elvis a vi-alike from:
ftp://ftp.cs.pdx.edu/pub/elvis/win32exe.tar.gz
and of course
perl -d
but of course I'm like that.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 13 Jun 1998 19:18:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Perl editor debugger
Message-Id: <6lujds$dbs$2@strato.ultra.net>
Keywords: editor debugger perl
[ posted and mailed ]
<p-lanphier@psu.edu> wrote:
-> What would you say is the best Perl editor/debugger available is
-> commercially or free for Windows NT?
Any text editor works great for editing and use the -d switch for debugging.
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-239-0341
and hang up when the recording starts. "
------------------------------
Date: Sat, 13 Jun 1998 21:15:42 +0200
From: Rotondo Roberto <rotondo@bluewin.ch>
Subject: Problems with <*> or <*.*>
Message-Id: <3582CFDD.609983B5@bluewin.ch>
Hello
statement: @link_files = @files = <*>
I'm running a Perl-Script with this statement under Windows 95. On this
statement the operatingsystem create an error -> "file or directory not
found".
I use the GSAR-Port (00402) and i did try also Active State. I think
there is a problem, when Perl try to get information about the
directory.
Can someone help me? Sorry for my bad English
Thanks
Roberto (from Switzerland)
------------------------------
Date: Sat, 13 Jun 1998 18:16:41 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Problems with installing perl in win 95 ....
Message-Id: <3582bec3.13877789@news.btinternet.com>
On Sat, 13 Jun 1998 18:58:41 +0200, Asbjxrn Hollerud wrote :
>I'm quite new to perl scripts so I decided to download almost ready to use
>scripts from The CGI Resources ( http://www.cgi-resources.com )
>The problem is that I have to install a perl program in order to modify the
>script. I'm using win 95....
>
This has got me all a bit confused I might say.
You dont *need* Perl to modify a Perl program you just need an editor
- notepad will suffice (after a fashion) for a modest script. However
you will need a Perl interpreter in order to run any program.
You can find out what Perl interpreters are available at
http://www.perl.com/latest.html
Once you have a Perl installed on your computer you will be able to
examine the wealth of documentation that comes with it. Prime amongst
these should be the documents collectively known as the FAQ. Once you
have got Perl working then you should be able to simply type:
perldoc perlfaq
at a command prompt in order to read this stuff.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 13 Jun 1998 18:23:49 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Return values of comparison operators
Message-Id: <358cc106.449091719@nntp.ix.netcom.com>
On 13 Jun 1998 15:24:11 GMT, andrew@pimlott.student.harvard.edu
(Andrew Pimlott) wrote:
>I just read that in Icon you can do something like
>
>if (0 < x < 10)
>
>because < returns it's right operand. I thought Perl was pretty clever to
>do something like this with || and &&, so why don't we have it for
>comparison operators?
>
>(Don't worry--I'm not suggesting changing existing behavior. Too late for
>that. Drat.)
This works in icon because the language has the concept of failure. 0
< x fails if 0 is not less than x. Only if 0 is less than x does it
return its right operand. if in icon tests for failure, not for the
value of the expression.
This wouldn't work in Perl because we want if to consider an
expression with value 0 as false. Consider
if (-2 < x < 0)
in icon. if x is -1 then the expression has value 0 and if treats it
as true. 0, like any other value, is taken as being true -- only
failure is false. But in Perl we want expressions with value 0 to be
treated as false.
The concept of failure carries quite a bit of baggage and I doubt if
you could justify incorporating it in a language just for this. Of
course, in icon the real justification for the concept of failure is
not things like this but the built in support for backtracking.
--
Michael M Rubenstein
------------------------------
Date: 13 Jun 1998 19:12:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: REVIEW: Perl CGI Programming - No Experience Required
Message-Id: <6luiv7$f59$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, c.c.eiftj@54.usenet.us.com (Rahul Dhesi) writes:
:He's not the only one who is confused; I am too. 'Programming Perl'
:on page 6 has a section that begins:
:
: Arrays: An array is an ordered list of scalars, accessed by the
: scalar's position in the list.
:This section, which is supposedly describing arrays, uses the words
:'list' and 'lists' 12 times on one page of text. After reading that
:section there was no doubt in my mind that 'array' and 'list' are
:synonymous. And who am I to question what Wall, Christiansen, and
:Schwartz write? The only obvious error I see in what Strom wrote
:(above) is that a list doesn't always have to be stored in a variable.
:But neither does an array, so I'm confused again.
Rahul, do you really not see the difference, or are you
just being intentionally obstreperous?
An array holds a list. This is easy. The bottom line has to do with
wither there's an AV * sitting around somewhere. Don't think that too
confusing for page six?
You can't say ++128, and you can't say pop(1,2,3) either.
Let he who calls an array a list, or vice versa, explain these.
And yes, some don't even compile. You need to explain that, too.
@a = qw('alpha', 'beta', 'gamma');
$x = @a;
$x = (1,2,3);
print \@a;
print \('alpha', 'beta', 'gamma');
$x = pop('alpha', 'beta', 'gamma');
$x = pop(@a);
sub foo_A { return @a }
sub foo_L { return ('alpha', 'beta', 'gamma') }
$x = foo_A();
$x = foo_L();
sub foo_P($) { print "got @_\n" }
foo_P('alpha', 'beta', 'gamma');
foo_P(@a);
foo_P(@a[0..2]);
These all clearly indicate that an array and a list are very different
creatues. You're just duped because arrays turn into lists on calls to
and returns from functions. So do hashes.
--tom
--
X-Windows: You'd better sit down.
--Jamie Zawinski
------------------------------
Date: 13 Jun 1998 20:03:40 GMT
From: sutok@gmx.de (Florian Kuehnert)
Subject: Re: Rounding Numbers
Message-Id: <slrn6o5mos.v8b.sutok@babelon.in-brb.de>
Jesse Rosenberger schrieb/wrote/icrivait/ha scritto:
>Let's say I have the number "56.5267391304348" I want Perl to shorten
>it to the hundreds place, and round, so that the output would be
>"56.53" (note the hundredths position was rounded up), how would I go
>about this.
Read the docs. Read the FAQ.
Florian
--
"Warum kostet Linux nichts?
Warum gibt es kein einheitliches Frontend?"
-- aus "Wie starte ich einen Endlos-Thread?", Teil 1327
(Holger Schauer in dcolm)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2866
**************************************