[11914] in Perl-Users-Digest
Perl-Users Digest, Issue: 5514 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 29 04:07:16 1999
Date: Thu, 29 Apr 99 01:00:19 -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 Thu, 29 Apr 1999 Volume: 8 Number: 5514
Today's topics:
Re: "learning perl" does not seem to be written well <uri@sysarch.com>
Re: $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex( (Ronald J Kimball)
-w bug (was Re: Script Help) (Ronald J Kimball)
?? and friend (was Re: what's wrong with $x = $y or "") (Ronald J Kimball)
Re: Better way? download a file from perl <swarren@slip.net>
Re: FAQ 4.73: How do I verify a credit card checksum? <davidk@nospam.cnct.com>
Re: FAQ not applicable (was: Eliminate elements from ar (Ronald J Kimball)
Re: Invalid Header ? <rick.delaney@home.com>
Looking <nessenj@ns.net>
Re: Looking <wyzelli@yahoo.com>
Re: Looking cindycrawford@my-dejanews.com
Re: May 3rd, SV.pm First Meeting!! <crb@highpoint.co.uk>
Re: NewBie: using If statment with multiple expressions <davidk@nospam.cnct.com>
Re: Not another Editor question?! Yes, but this one's d <ronald_f@my-dejanews.com>
Re: PERL & Y2K (Ronald J Kimball)
Re: Problem with Perl on Windows... <crb@highpoint.co.uk>
Searching a Text File by key <sales@carlmotors.com>
Re: stupid single quote " wipes out REST OF TEXT <bdp@mutagenic.org>
Re: stupid single quote " wipes out REST OF TEXT (Ronald J Kimball)
Re: stupid single quote " wipes out REST OF TEXT (Larry Rosler)
Re: What does this error message mean? (Blair Kingsland)
Re: What does this error message mean? (Ronald J Kimball)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Apr 1999 00:11:40 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "learning perl" does not seem to be written well
Message-Id: <x7ogk883r7.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@fnx.com> writes:
A> Uri Guttman (uri@sysarch.com) wrote on MMLXVI September MCMXCIII in
A> <URL:news:x7vheh8hic.fsf@home.sysarch.com>:
A> ;;
A> ;; i call it bind as it binds the value on the left to the m//, s/// or
A> ;; tr/// on the right. whethere it gets modified or not depends on the
A> ;; rigth side only.
A> Uhm, not quite. Tell me, does $foo in: $foo =~ s/foo/bar/; get
A> modified or not? I believe it depends on $foo as well....
you know what i meant. i agree, the left side will affect whether the
s/// modifies it. the thread was talking more about the =~ op and my
point was that bind is a good description for it. maybe i should have
said modification of the left side is not important to understanding
what =~ does. why it is hard to grok by some people is hard for me to
grok. =~ is one of perl's more important ops as you don't need oodles of
builtin funcs to support all the things =~ does.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Thu, 29 Apr 1999 01:58:23 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
Message-Id: <1dqzwi5.uetixz1hul47iN@p31.tc2.state.ma.tiac.com>
Benjamin Franz <snowhare@long-lake.nihongo.org> wrote:
> It is a legacy from code I wrote in the days of when the Pink Camel
> was my primary reference and I was very new to Perl. The Pink Camel
> didn't clearly indicate that what came back was year-1900
It's even worse than that.
As you say, the description of localtime() in the Pink Camel doesn't
even mention any specific issues with $year.
There are also two examples of use of localtime() in the Pink Camel. In
the first [lastlogin - pg 261], 1900 is added to the year. But in the
second example [wrapman - pg 321], '19' is prepended to the year. Doh!
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -le 'print "Just another \u$^X hacker"'
------------------------------
Date: Thu, 29 Apr 1999 01:58:27 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: -w bug (was Re: Script Help)
Message-Id: <1dr00m6.19ug83y1oe484dN@p31.tc2.state.ma.tiac.com>
Tad McClellan <tadmc@metronet.com> wrote:
> : #!/usr/bin/perl
>
>
> You have a bug on the very first line of your program.
>
> See the very first bug listed in the BUGS section of the
> top-level perl man page (perl.pod).
This comment really bothers me.
The BUGS section of perl.pod lists bugs in *Perl*; -w not being required
is a bug in Perl, not in the Perl script.
If -w is missing from the #! line, it is simply an omission, an
oversight, or foolishness :) , but not a bug.
--
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -we'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-
------------------------------
Date: Thu, 29 Apr 1999 01:58:39 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: ?? and friend (was Re: what's wrong with $x = $y or "")
Message-Id: <1dr02cd.mhq0xw1baht2uN@p31.tc2.state.ma.tiac.com>
Abigail <abigail@fnx.com> wrote:
> Now if only we had the ?? operator....
Recently it occured to me that, if we did have the ?? operator, for
symmetry we would need to have a written out version as well (&& - and,
|| - or). Of course, the written out version would have much lower
precedence, just like its equivalents.
That operator would have to be named 'dor'.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Apr 1999 07:28:32 GMT
From: "Stephen Warren" <swarren@slip.net>
Subject: Re: Better way? download a file from perl
Message-Id: <ASTV2.4532$gv5.2585@news.rdc1.sfba.home.com>
Greg Lucas <flighttime@earthlink.net> wrote in message
news:280419990044133791%flighttime@earthlink.net...
> I'm trying to allow users to download a file created on the fly from
> a script using:
>...
> Is there a way to name this file? right now it comes across as the name
This isn't a Perl question.....
You need to read the specification for MIME. It's in one of the RFCs. One of
the headers (Content-Disposition, I think) allows you to specify a filename.
Is application/plain really the correct MIME type for what you're sending
back?
------------------------------
Date: Thu, 29 Apr 1999 02:34:50 -0400
From: "Dave Kaufman" <davidk@nospam.cnct.com>
Subject: Re: FAQ 4.73: How do I verify a credit card checksum?
Message-Id: <7g8umn$el4@world2.bellatlantic.net>
Tom Christiansen wrote...
> How do I verify a credit card checksum?
> Get the Business::CreditCard module from CPAN.
or just:
$cardno =~ s/\D//g;
while (length($cardno)) {
$chktotal += chop($cardno);
$chktotal += (($chkdigit = chop($cardno)) < 9) ? ($chkdigit * 2) % 9 : 9;
}
die "Invalid credit card number" if $chktotal % 10;
-dave
------------------------------
Date: Thu, 29 Apr 1999 01:58:25 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: FAQ not applicable (was: Eliminate elements from array with second array?)
Message-Id: <1dqzy1j.1gte6oq1vpdiakN@p31.tc2.state.ma.tiac.com>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
> lou@visca.com writes:
>
> > My thanks to all who answered, but as Andrew Allen points out, the
> > FAQ isn't applicable in my case.
>
> Then you probably misunderstood your own question :-)
Not every question is answered in the FAQs, you know.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Apr 1999 04:02:01 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Invalid Header ?
Message-Id: <3727D960.D5051BAE@home.com>
[posted & mailed]
Tim Armbruster wrote:
>
> Thorsten Latka specifically mentioned the error, which was a Perl coding
> error (as well as CGI). She simple forgot to produce a proper header, which
> could have been remedied had she posted code.
I don't recall seeing any error from perl mentioned. Posting code would
not have made this a Perl question.
> Eric the Read had already mentioned the proper newsgroup, if her question
> had not been about Perl.
The question was definitely not about Perl. Fortunately for the
original poster, Eric had some knowledge of where the question could be
answered. If you found this answer sufficient, why bother posting your
out of context message?
> Re: Invalid Header? is pretty self-explanatory, I think, and you obviously
> knew what I was replying to since you mentioned it in your post.
'Invalid Header' may make sense to someone who uses CGI but it is quite
meaningless in this newsgroup. Regardless, I don't see how this is a
defense for poor netiquette.
> Lay off or Lighten up.
If you don't like having your posts criticized then maybe you shouldn't
post. Or you could try learning how to post. Here's a good place to
start:
news.announce.newusers
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 29 Apr 1999 05:18:48 GMT
From: James Nessen <nessenj@ns.net>
Subject: Looking
Message-Id: <Pine.GSO.4.10.9904282216530.24501-100000@destroyer.sac.verio.net>
Hello,
I am looking for a perl script that goes through a web access_log
and counts up the number of bytes transferred. I am still new to
perl, and I can't seem to find out how it's done. If anyone can be of
any assistance, it would be much appreciated.
Thanks!
Jim
------------------------------
Date: Thu, 29 Apr 1999 14:55:20 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Looking
Message-Id: <43SV2.10$8W2.4536@vic.nntp.telstra.net>
James Nessen wrote in message ...
>Hello,
> I am looking for a perl script that goes through a web access_log
>and counts up the number of bytes transferred. I am still new to
>perl, and I can't seem to find out how it's done. If anyone can be of
>any assistance, it would be much appreciated.
>
>Thanks!
>
>Jim
>
I have just finished writing/modifying such a script to process a radius
log.
I get
username time-online Mb-Sent Mb-Received
Are you using radius?
or is it something different?
Wyzelli
------------------------------
Date: Thu, 29 Apr 1999 07:42:53 GMT
From: cindycrawford@my-dejanews.com
Subject: Re: Looking
Message-Id: <7g92hs$sdb$1@nnrp1.dejanews.com>
http://cgi-shop.com
you will find there a lot of free cgi scripts
cindy
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 07:21:22 GMT
From: "Craig R. Belcham" <crb@highpoint.co.uk>
Subject: Re: May 3rd, SV.pm First Meeting!!
Message-Id: <3727FAF5.1BC89E54@highpoint.co.uk>
fxia@yahoo.com wrote:
> Next Meeting Monday, May 3, 1999 7:00 pm
A PERL mongers meeting on my birthday, Im touched!:)
Craig
--
Craig R. Belcham. Internet Systems Management Consultant.
Email: crb@highpoint.co.uk, http://www.highpoint.co.uk/~crb
"The greatest trick the devil ever pulled was convincing the
world that he didn't exist" -- Kevin Spacey, Usual Suspects.
------------------------------
Date: Thu, 29 Apr 1999 02:39:55 -0400
From: "Dave Kaufman" <davidk@nospam.cnct.com>
Subject: Re: NewBie: using If statment with multiple expressions
Message-Id: <7g8uvq$fsq@world2.bellatlantic.net>
Dennis wrote...
>Can anyone give me a hint how i can use multiple expressions in a if
>statement, like:
>if ( value = 1 OR value = 2 OR value = 3 ) then....
try:
if ($numericvalue == 1 or $stringvalue eq "two" or $booleavalue) {
#then....
# do whatever
}
# heres a bonus
else {
# do something else
}
------------------------------
Date: Thu, 29 Apr 1999 06:08:16 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Not another Editor question?! Yes, but this one's different... sorta.
Message-Id: <7g8t0e$mu0$1@nnrp1.dejanews.com>
In article <7g7qqb$psq$1@murdoch.acc.Virginia.EDU>,
dsf3g@node2.unix.Virginia.EDU (David Salvador Flores) wrote:
> In article <7g6aq4$e1e$1@nnrp1.dejanews.com>,
> Ronny <ronald_f@my-dejanews.com> wrote:
> >(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs"
> >t) (setq cperl-hairy t) (setq auto-mode-alist (append
> >'(("\\.\\([pP][Llm]\\|al\\)$" . perl-mode)) auto-mode-alist )) (setq
> >interpreter-mode-alist (append interpreter-mode-alist '(("miniperl" .
> >perl-mode)))) (defun my-cperl-setup () (cperl-set-style "C++")) (add-hook
> >'cperl-mode-hook 'my-cperl-setup)
>
> So am I supposed to create a file named .emacs in my home directory and
> copy this text in to it? Is that the idea?
Yes. In practice, you'll probably put a bit more into ~/.emacs. Emacs is
written to a large extent in Lisp, and customization is done by executing at
startup time the Lisp program found in .emacs.
>From your question I assume you've never worked with Emacs before. It is a
good idea to spend first a few hours tailoring Emacs, since it is so useful
then.
If you look at the help menu, you find a submenu "Manuals" and then the
entry "Browse Manuals With Info". You can read there about customization, and
they also have a sample .emacs. Also, the FAQ's (also included in the
distribution) are written well and useful.
Another way to customize Emacs is to use Help/Customize. This actually updates
(or creates) ~/.emacs for you. Using this is easy, but you can't do everything
that way, of course. For instance, you can not install cperl-mode.
If you have further questions, move over to gnu.emacs.help, or drop me
a personal email (which i won't answer before end of May, though, because
I'm going for holiday right now....).
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 29 Apr 1999 01:58:26 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: PERL & Y2K
Message-Id: <1dqzyxj.1njim9r1hdmhybN@p31.tc2.state.ma.tiac.com>
Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
> Of course there is something to fix in that. I didn't say there wasn't
> I said (obviously badly) that since the original poster was too stupid to
> read the documnetation that comes with perl on the subject. And too stupid
> to do a simple search of the subjects of the days posts to find their answer.
> Then even if they do find a magical tool that 'scans PERL script for Y2K
> compliane' they are obviously too stupid to fix anything it finds.
I don't understand... Why do you say the original poster is too stupid
to read the documentation?
He didn't ask if Perl is Y2K compliant. He asked if there are any tools
that scan Perl *scripts* to find Y2K bugs. Such as the 'printf "The
year is 19%d\n", (localtime) [5];' that Abigail provided.
I simply cannot fathom your logic...
I agree with Abigail; you are confused. Take a deep breath, and come
back tomorrow when you're more rational. :)
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Apr 1999 07:24:35 GMT
From: "Craig R. Belcham" <crb@highpoint.co.uk>
Subject: Re: Problem with Perl on Windows...
Message-Id: <3727FBB6.85FF398E@highpoint.co.uk>
Robert Kuropkat wrote:
>
> Can't locate DynaLoader.pm in @INC (@INC contains: F:\PERL\lib .) at
> F:\PERL\lib/Date/Calc.pm line 15.
> BEGIN failed--compilation aborted at test.pl line 48.
>
> Other tests gave a similar message about Autoloader.pm. My system does not
> seem to have either DynaLoader.pm or Autoloader.pm, which, presumably is why
> perl "Can't locate..." it.
>
Youll need to install the module, I dont know about PerlMagic, but if
you use ActiveState then the relevant CPAN packages are avaliable from
www.activestate.com
--
Craig R. Belcham. Internet Systems Management Consultant.
Email: crb@highpoint.co.uk, http://www.highpoint.co.uk/~crb
"The greatest trick the devil ever pulled was convincing the
world that he didn't exist" -- Kevin Spacey, Usual Suspects.
------------------------------
Date: Wed, 28 Apr 1999 23:28:11 -0500
From: "Carl Motors, Inc." <sales@carlmotors.com>
Subject: Searching a Text File by key
Message-Id: <3727DFDB.73E0615@carlmotors.com>
I own
"Programming Perl" (Wall/Christenson/Swhwartz) and
"Official guide to programming with cgi.pm" (Stein) as references.
I have also had to use AWK in the past.
I have successfully written a basic perl script using the cgi.pm module
to output form data to a file. A handy module indeed, to get started
anyway.
Here is my question:
What is the best way to search a text file with form parameters passed
to a script? Can i use the pattern matching? If so how do I translate
the parameter, which holds the search key, to a pattern?
I am looking for some jump-start suggestions. Perhaps it is not possible
and I should proceed with an actual database file search instead? Or
maybe I should go to the "Learning Perl" book that is allegedly more
helpful. If someone could get me on track I would appreciate it. I need
to create your basic "file search" web page functionality.
--
Bob Carl, Jr.
------------------------------
Date: Wed, 28 Apr 1999 23:23:02 -0600
From: Brian Peisley <bdp@mutagenic.org>
Subject: Re: stupid single quote " wipes out REST OF TEXT
Message-Id: <3727ECB6.EF50BF68@mutagenic.org>
NOSPAMcrstlblu@planet.eon.net wrote:
>
-snip-
> escaping BEFORE entering the $value into the hidden field would be
> insane, because then I'd be CHANGING the value, which is NOT MY RIGHT,
^^^^^^^^^^^^
This is ridiculous. Using this logic, you may as well donate your computer to a
local school because it stores everything as 1's and 0's. I'm willing to bet
that none of your end users will care one bit about how the information is
stored or passed to a browser, just how it is displayed in the browser. If you
alter the information sent to the browser so that it is displayed correctly,
who is this hurting?
-snip-
> so if it works WITHOUT escapeing in the 1st script, WHY would it require
> escaping in the 2nd script? this is ILLOGICAL!
Just because you tried to shoot yourself in the foot once and missed doesn't
mean you won't hit it the second time.
-snip-
> This is my last attempt to have a PracticalExtractionandReportLanguage question
> answered in this PERL newsgroup - thanks for all of your time,
If you really want a perl answer to your HTML/CGI question, try one of these:
s/comp\.lang\.perl\.misc/comp.infosystems.www.authoring.html\g
or
s/comp\.lang\.perl\.misc/comp.infosystems.www.authoring.cgi\g
Brian Peisley
bdp@mutagenic.org
------------------------------
Date: Thu, 29 Apr 1999 01:58:36 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: stupid single quote " wipes out REST OF TEXT
Message-Id: <1dr013c.kuo9qkpw62uaN@p31.tc2.state.ma.tiac.com>
<NOSPAMcrstlblu@planet.eon.net> wrote:
> On Wed, 28 Apr 1999 08:39:35 -0400, tadmc@metronet.com (Tad McClellan) wrote:
> > $value =~ s/"/"/g; # escape double quotes as REQUIRED
> $content=~ s/"/"/d; > > TRIED YOUR IDEA HERE AND GOT AN ERROR
^^
Try again. This time use the correct /x modifier. ;)
(/d means something for tr///, but not s///. /g means something for
s///, but not tr///.)
> it's NOT A MATTER OF HTML friend, the PROOF is that in the FIRST cgi
> script, when the value of $value is: "200 chars, 5'10", and 200 chars" NO
> QUOTE ESCAPE IS NECESSARY IN ORDER for $value to be printed PERFECTLY!
> *note: the script declares the variable as from a DBM file
> $value=$dbhash{$dbkey{'thevalue'}};
> "200 chars, 5'10", and 200 chars" is simply WHAT IS IN THE DBM, it is
> NEVER WRITTEN in the script - SILLY.
>
> so if it works WITHOUT escapeing in the 1st script, WHY would it require
> escaping in the 2nd script? this is ILLOGICAL!
Wow, you really are dense. :( It doesn't require escaping in the
script; it requires escaping IN THE HTML. I.e., in the HTML being
output by your second script.
Imagine if you had Perl code that looked like this:
$string = "This is a double-"ed string."; # BAD!
What is Perl going to do with that? You've got a double-quote 'inside'
a double-quoted string. The string will actually be "This is a
double-", and then there will be some other stuff after that, and your
script will almost certainly not compile.
So you have to escape that double-quote:
$string = "This is a double-\"ed string."; # GOOD
Perl lets you escape that double-quote with a backslash.
Well, HTML is the same way:
<INPUT TYPE=hidden NAME=var VALUE="This is a double-"ed string.">
<!-- BAD! -->
Once again, there's a double-quote 'inside' your double-quoted string.
So your browser (note: your _browser_) reads the string as "This is a
double-", and then there's some other junks which must be more
attributes to the HTML tag.
Once again, you have to escape that double-quote. But this time it's
the browser interpreting HTML, not Perl compiling a script. In HTML,
you don't use backslashes for escapes; you use ampersand entities:
<INPUT TYPE=hidden NAME=var VALUE="This is a double-"ed string.">
<!-- GOOD -->
Now your browser reads "This is a double-"ed string." as the whole
string. If it were a regular TEXT entry input, rather than hidden, it
would show up on the screen as This is a double-"ed string, because the
browser translates the entity into the appropriate character.
Thus, implement Tad's suggestion properly, and you should be good to go.
Good luck!
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'
------------------------------
Date: Thu, 29 Apr 1999 00:06:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: stupid single quote " wipes out REST OF TEXT
Message-Id: <MPG.1191a4d1b8c0aaa0989972@nntp.hpl.hp.com>
In article <371bb76e.1617532@news.planet.eon.net> on Thu, 29 Apr 1999
00:34:03 GMT, NOSPAMcrstlblu@planet.eon.net
<NOSPAMcrstlblu@planet.eon.net> says...
...
> foreach $item(@pairs) {
> ($key,$content)=split(/=/,$item,2);
> $content=~tr/+/ /;
> $content=~ s/"/"/d; > > TRIED YOUR IDEA HERE AND GOT AN ERROR
> $content=~ s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
OK. Let me try to put an end to this ugly thread. I have snipped all
your shouting and ranting below here. It takes only three points to
resolve the issue.
1. The loop above is processing your CGI input, either from
$ENV{QUERY_STRING} or from STDIN. The line with your shouting on it
doesn't belong here at all. If the following line (with the 'pack')
comes across an escape sequence (%22) that produces a double-quote in
the input data, fine! It is perfectly acceptable there.
2. Printing HTML text containing double-quote characters to the browser
via STDOUT is OK. Double-quotes are perfectly acceptable there. But it
does no harm to escape them as " also.
3. Inserting text into HTML tags containing double-quote characters is
NOT acceptable. There double-quotes (and several other characters) have
special syntactic properties (as you have discovered) and *must* be
escaped.
Move your faulty line (after correcting the /d to /g, as others have
noted) from processing the input to processing the output, and all will
be well.
If this doesn't get through to you, nothing will.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 29 Apr 1999 04:30:16 GMT
From: blairk@istar.ca (Blair Kingsland)
Subject: Re: What does this error message mean?
Message-Id: <NfRV2.563$T52.677726@NewsRead.Toronto.iSTAR.net>
Thank you all for your overwhelming and generous responses. You have
solved my simple problem.
I debugged my program using v5.005_02 but my web hoster is running an
earlier version. I will use define().
Thanks.
Blair Kingsland
------------------------------
Date: Thu, 29 Apr 1999 01:58:38 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: What does this error message mean?
Message-Id: <1dr021z.xgt7co1it5qdfN@p31.tc2.state.ma.tiac.com>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
> > That's a bit odd. However, 65535 is FFFF in hex, which is -1 as signed
> > word. So it's off your script.
>
> I believe this is a bug. I am able to reproduce it:
>
> % perl -w
> open F, "somefile";
> while ($i = <F>) {}
> __END__
> Value of <HANDLE> construct can be "0"; test with defined() at - line 65535.
> Name "main::i" used only once: possible typo at - line 2.
>
> Notice that the warning is displayed *after* the __END__ meaning that
> it was encountered at run-time.
% perl -wc
open F, "somefile";
while ($i = <F>) {}
__END__
Value of <HANDLE> construct can be "0"; test with defined() at - line 65535.
Name "main::i" used only once: possible typo at - line 2.
- syntax OK
%
Does perl -c usually print out run-time error messages?
The fact that the message appeared after __END__ simply means that the error
was output at the end of the compilation stage, not that it was output after
the program started running.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5514
**************************************