[8182] in Perl-Users-Digest
Perl-Users Digest, Issue: 1800 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 3 17:12:49 1998
Date: Tue, 3 Feb 98 14:01:34 -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 Tue, 3 Feb 1998 Volume: 8 Number: 1800
Today's topics:
Re: Really Stupid Question (John Doen)
Re: recreating sed with perl <ldanna@hotmail.com>
Regular expression expander <adamk@cyrix.com>
Re: Retrieving remote web page (Jonathan Stowe)
setlocale warnings sayuj@sycon-design.com
Re: setlocale warnings (Chip Salzenberg)
Re: solution for multiline comments??? (Bjvrn Nilsson)
Re: solution for multiline comments??? (Chip Salzenberg)
Re: Trying to find good PERL book (Hasan Diwan)
TTY Devices? (Greg Wake)
Re: TYP21D (was: substitute...) (Andrew M. Langmead)
using unix commands in perl <kigray@cs.utexas.edu>
Variable passing with an URL <gbrown@cae.ca>
warning messages <mab@sycon-design.com>
Re: Year 2000 (Y2K) Compliance <ldanna@hotmail.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 03 Feb 1998 18:53:11 GMT
From: tmagnum@coredcs.com-nospam (John Doen)
Subject: Re: Really Stupid Question
Message-Id: <34d76744.870170850@snews2.zippo.com>
Actually I found the problem by working through your test script.
the problem with this If statement:
#!/usr/bin/perl -w
$| = 1;
print "Content-type: text/html\n\n";
require "/usr/apache/cgi-bin/cgi-lib.pl";
&ReadParse(*form_data);
$FrontChoice = $form_data{'choice'};
if ($FrontChoice eq "techhelp")
{
&PrintStuff;
exit;
}
is that the variable $FrontChoice contained in the If statement was
not in parentheses.
Thanks for hte help...told you it was a stupid question.
On Fri, 30 Jan 1998 19:16:22 -0600, tadmc@flash.net (Tad McClellan)
wrote:
>John Doen (tmagnum@coredcs.com-nospam) wrote:
>: On Fri, 30 Jan 1998 19:30:32 GMT, chip@mail.atlantic.net (Chip
>: Salzenberg) wrote:
>
>: >According to tmagnum@coredcs.com-nospam (John Doen):
>: >>I'm working on a form where the user submits info a perl script
>: >>processes their choice and outputs the appropriate page. Easy right?
>: >>Yes it should be. I'm having problems getting the script, contacted
>: >>below, to get through the If statement. When I run it in debug mode I
>: >>get a "Use of Uninitialzed Variable" error on the line with the If
>: >>statement.
>: >
>: >Well, then maybe it's using an uninitialized variable?
>: >
>: >"Hello? McFly?!"
>: >
>: >CGI, CGI, CGI. Will no one rid me of this accursed CGI?
>: >--
>: >
>
>: I said it was a stupid question, but ummm no kidding. how do I fix
>: it?
>
>
>You ensure that $FrontChoice is defined ;-)
>
>... and since it is set from $form_data{'choice'}, you ensure that
>it is defined too.
>
>
>After your ReadParse() call (I almost skipped answering when I saw
>cgi-lib.pl. You really should be using CGI.pm by now...) check
>to see if it is getting your form stuff correctly:
>
>
>if (defined ($form_data{'choice'}))
> {print \$form_data{'choice'} is defined\n"}
>else
> {print \$form_data{'choice'} is NOT defined\n"}
>
>
>Of course you need to figure out some way to see the output of
>the if/else. Use warn() instead of print and check your server
>log, or chang the Content-type, or some other CGIy thing that's
>best discussed in a newsgroup about CGI. This one isn't.
>
>
>--
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Tue, 03 Feb 1998 15:02:06 -0500
From: Larry D'Anna <ldanna@hotmail.com>
Subject: Re: recreating sed with perl
Message-Id: <34D777BE.D49CE81A@hotmail.com>
Mattias Lvnnqvist wrote:
>
> michael_moore@idx.com wrote:
>
> > Hi. I'm looking to recreate the Unix sed functionallity in perl on a
> > win32 system. Before I reinvent the whell, I was wondering if anyone
> > else has already done this and if they'd be willing to share the code
> > with me.
> >
> > Thanks,
> > Mike
>
> Umm, you are aware Sed exists for windows already? Its - if I remember
> correctly - part of the Cygnus GnuWIN32 distribution.
>
A sed with perl RE's would be pretty nifty tho.
BTW: is my news reader screwing up line wrappings? I can't
tell
because it fixes them when it reads them back in :(
---------------------------------------------------
|Democracy is the worst system of government. --
|Except for all the others
| -Winston Churchill
---------------------------------------------------
Larry D'Anna "eschew obfuscation"
------------------------------
Date: Tue, 03 Feb 1998 13:53:34 -0600
From: Adam Krolnik <adamk@cyrix.com>
Subject: Regular expression expander
Message-Id: <34D775BE.518D@cyrix.com>
Good afternoon:
After trying to decipher someone else's regular expression code, we
wondered if anyone has though about using a regular expression
to generate text.
Instead of using regular expressions to match text, instead take
a regular expression and generate legal combinations of text
that it describes. This would seem to be a helpful tool for
writing correct regular expressions as one could directly see
what is being specified. I do understand that it would not be able
to exhaustively generate the combinations, but I would think that
one could assign limits to the operators, e.g. \d == {0,1,2}
+ == {1,2}, * == {0,1}, . == {.,a,%}. Since a program like this
would have to parse the regular expression, I think it would have
to use part of the regular expression compilation code and have a
different evaluator - an expander instead of a matcher.
Adam Krolnik
Verification Engineer
Cyrix - NSM.
Richardson TX, 75085
------------------------------
Date: 3 Feb 1998 19:25:14 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Retrieving remote web page
Message-Id: <6b7quq$2bh$4@uranium.btinternet.com>
In article <886512275.1285488648@dejanews.com>, marlontan@hotmail.com
says...
>
>To whom it may concern:
>
> Do you know how to retrive remote web pages using CGI Script? What if
>the remote page does not exist? It is just generated by another CGI
>Script? How would you tell the other server to generate the page and give
>it to you? Thank you and more power.
>
The LWP:: module (libwww-perl) provides some great facilities for this kind
of stuff. Look at the supplied program lwp_request (?) usually linked as
GET for an example of how your aim could be addressed.
Jonathan
------------------------------
Date: 03 Feb 1998 12:14:20 -0800
From: sayuj@sycon-design.com
Subject: setlocale warnings
Message-Id: <6owwfccuoz.fsf@sycon-design.com>
Hi,
I get the following warnings when I run perl (on Linux as well as
Solaris).
warning: setlocale(LC_CTYPE, "") failed.
warning: LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "us",
warning: falling back to the "C" locale.
Any help on why does it happen and how can I avoid it ?
Sayuj
------------------------------
Date: Tue, 03 Feb 1998 21:33:35 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: setlocale warnings
Message-Id: <6b82iu$s3f$1@cyprus.atlantic.net>
According to sayuj@sycon-design.com:
>I get the following warnings when I run perl (on Linux as well as
>Solaris).
>
>warning: setlocale(LC_CTYPE, "") failed.
>warning: LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "us",
>warning: falling back to the "C" locale.
>
>Any help on why does it happen and how can I avoid it ?
Apparently you have the LANG environment variable set to "us",
whereas your C libraries can't find any such locale.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: Tue, 03 Feb 1998 21:31:27 +0100
From: s93bni@csd.uu.se (Bjvrn Nilsson)
Subject: Re: solution for multiline comments???
Message-Id: <s93bni-ya02408000R0302982131270001@snews.zippo.com>
Hi all!
It seems like I took the "lazyness" part in "Programming Perl" a bit too
seriously. Quite a few of the answers suggested using POD, so I took a look
at the documentation of that. Indeed it's the solution that I look for. But
really, wouldn't a solution like:
/******
* This is a comment about what is to follow.
* This class is a nonsense class that really does nothing but
* serving as an example.
*******/
i.e. a notation like the /* C, C++, Java etc */ commenting be a nice
feature in Perl as well?
Thanks all
Bjvrn
In article <34D5AA8A.7165D7A5@edt.ericsson.se>, "Bjvrn Nilsson"
<bjorn.w.nilsson@edt.ericsson.se> wrote:
> Hi all!
>
> Has anyone figured out how to in a convienient way do mulitline comments
> a la C, Java etc.
> OK, I know that one solution is to write a perl snippet that looks for
> some special tags (e.g. startcomm and endcomm) and than comment
> everything out in between those lines.
>
> But is there some kind of simpler solution, where I don't have to
> process a script with a script?
>
> Bjvrn
------------------------------
Date: Tue, 03 Feb 1998 21:34:50 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: solution for multiline comments???
Message-Id: <6b82l9$s40$1@cyprus.atlantic.net>
According to s93bni@csd.uu.se (Bjvrn Nilsson):
>i.e. a notation like the /* C, C++, Java etc */ commenting be a nice
>feature in Perl as well?
No.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Boy, is it ever dark." "I hope they don't get a moonburn." // MST3K
-> Ask me about Perl training and consulting <-
Like Perl? Want to help out? The Perl Institute: www.perl.org
------------------------------
Date: 3 Feb 1998 16:34:36 -0500
From: hdiwan@shell.clark.net (Hasan Diwan)
Subject: Re: Trying to find good PERL book
Message-Id: <6b82hc$6ib@shell.clark.net>
O'reilly is no person (well, maybe), but in this case, it refers to a
technical book publisher in Sevastopol CA located at http://www.ora.com
mcintyres@hjc.cc.md.us (Scott McIntyre) writes:
>Hi all,
>I have been watching the discussions in this forum and have noticed
>that the name O'Reilly is mentioned quite often. I have been
>searching for books by this person but don't have enough information
>to find any matches.
>Could one of you be so kind as to tell me what this gentleman's
>complete name is. Any response would be greatly appreciated.
>Thanks.
>Best Regards,
>Scott McIntyre
>======================================================================
> HAGERSTOWN JUNIOR COLLEGE E-MAIL: mcintyres@hjc.cc.md.us
> 11400 ROBINWOOD DRIVE PHONE: 301-790-2800 x327
> HAGERSTOWN MD 21742-6590 USA FAX: 301-739-0737
>======================================================================
> Home Page: http://www.hjc.cc.md.us/
>======================================================================
--
Hsiang Huang
University of California at Berkeley
Department of Electrical Engineering/Computer Science
hasandiwan@writeme.com
------------------------------
Date: Tue, 03 Feb 1998 03:59:24 GMT
From: greg@geographe.com.au (Greg Wake)
Subject: TTY Devices?
Message-Id: <34d695b6.63668164@192.168.3.61>
Does anyone know of a module which interfaces to TTY devices in a Unix
environment??
Alternatively, any docs on the net showing simple input/output to a
TTY device would be good.
Thanks in advance.
------------------------------------------------------------------------
Greg Wake | Phone: +61 97 911 915
Systems Manager |
Geographe Replacement Parts | Fax: +61 97 911 916
P.O. Box 350 |
BUNBURY 6231 | E-Mail: greg@geographe.com.au
Western Australia |
-----------------------------------------------------------------------
------------------------------
Date: Tue, 3 Feb 1998 18:54:28 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: TYP21D (was: substitute...)
Message-Id: <EntGIs.9zM@world.std.com>
davet@angel.uunet.ca (Dave Till) writes:
>I suppose the worst-case is something like this:
> $myvar = 1;
> while ($myvar < 10) {
> print ("hello there\n");
> $myva++;
> }
> print ("$myva\n");
>This program sails right through -w. (Obviously, this is a
>contrived example -- but a larger program with multiple nested
>loops might get tripped up by this.)
Maybe we are at the point where tuturial books should start by
teaching the "use strict" pragma, and the corresponding programming
practices that it forces. Even if it doesn't explain _how_ it
works. Just tell the reader "this is some boilerplate stuff that every
script should have."
#!/usr/bin/perl -w
use strict;
--
Andrew Langmead
------------------------------
Date: Tue, 03 Feb 1998 15:48:54 -0600
From: Kimbrough Gray <kigray@cs.utexas.edu>
Subject: using unix commands in perl
Message-Id: <34D790C6.11C8@cs.utexas.edu>
I'm trying to copy a file from one directory to another.
I've been typing in
cp help.html fun/help.html;
And I have been getting an error which reads
"Search pattern not terminated at add.cgi line 14"
Line 14 is "cp help.html fun/help.html;"
I thought I had heard that you could type in Unix commands directly
into your perl code but maybe I am incorrect.
------------------------------
Date: Tue, 03 Feb 1998 16:06:12 -0500
From: Gil Brown <gbrown@cae.ca>
Subject: Variable passing with an URL
Message-Id: <34D786C4.446B@cae.ca>
Hi everybody;
I am trying to pass a variable to a cgi script through an URL:
print "<LI li
type=disc><ahref=\"http://chevy.cae.ca",$CGI,"/allo.cgi\"?allo>USER</a>\n";
My problem is I can't get it back in the cgi. Does anybody know what's
missing.
Thanks
--
Gil Brown
System Administrator Dept.80
CAE Electronics Ltd
gbrown@cae.ca
"It's not denial."
"I'm just very selective about the reality I accept." --Calvin
------------------------------
Date: Tue, 3 Feb 1998 12:41:08 -0800
From: "Michael Bezman" <mab@sycon-design.com>
Subject: warning messages
Message-Id: <6b7s4m$qtc@news.biz.net>
Hi !!!
When I am running perl - I am getting the following warning messages :
warning: setlocale(LC_CTYPE, "") failed.
warning: LC_ALL = "(null)", LC_CTYPE = "(null)", LANG = "us",
warning: falling back to the "C" locale.
Does anybody know what it is about and how I can get rid of them ?
Thank you. Mike
------------------------------
Date: Tue, 03 Feb 1998 15:10:56 -0500
From: Larry D'Anna <ldanna@hotmail.com>
Subject: Re: Year 2000 (Y2K) Compliance
Message-Id: <34D779D0.9E2763F8@hotmail.com>
>>>>> "Bill" == Bill <billl@ctgusa.com> writes:
Bill> Could someone guide me to any information or
discussion on
Bill> Perl's Year 2000 compliance? Got a Government contract
and they
Bill> are real concerned about Year 2000 (Y2K) compliance
and I really
Bill> want to assure them about Perl.
IMHO, The phrase "Y2K Compliant" has almost as little
meaning as
"Information Superhighway" or "ActiveX". The year 2000 is
not
a specification or a standard that something can "comply"
to.
It is a date. The fact that there are several programs
written
in stupid ways that make them break once that date is
reached
does not make that date special.
---------------------------------------------------
|Democracy is the worst system of government. --
|Except for all the others
| -Winston Churchill
---------------------------------------------------
Larry D'Anna "eschew obfuscation"
------------------------------
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 1800
**************************************