[18696] in Perl-Users-Digest
Perl-Users Digest, Issue: 864 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 9 18:06:01 2001
Date: Wed, 9 May 2001 15:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989445911-v10-i864@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 9 May 2001 Volume: 10 Number: 864
Today's topics:
Re: $a . $a++ or Perl for vulcans? nobull@mail.com
Re: $a . $a++ or Perl for vulcans? <jbehren@gwdg.de>
Re: $a . $a++ or Perl for vulcans? <dan@tuatha.sidhe.org>
Re: $a . $a++ or Perl for vulcans? <news@simonflack.com>
Re: $a . $a++ or Perl for vulcans? <ren@tivoli.com>
Re: basic TRUE / FALSE <todd@designsouth.net>
Connect to another pc. <javier.jara@bb-data.de>
Re: Good editor for perl Use Scite ! <smilepak@hotmail.com>
Re: Invoking Perl script from a web page (graphic/SSI) <peek@industrologic.com>
Re: Invoking Perl script from a web page <news@simonflack.com>
Re: Invoking Perl script from a web page <japh@flashmail.com>
Re: Is this a (var name/tr) bug, can anyone verify it?? <godzilla@stomp.stomp.tokyo>
Re: latest stable version of Perl (Craig Berry)
Re: latest stable version of Perl <godzilla@stomp.stomp.tokyo>
Re: List equality (Craig Berry)
Re: List equality <ren@tivoli.com>
Re: Local Time <todd@designsouth.net>
Re: Local Time <todd@designsouth.net>
Re: Local Time <todd@designsouth.net>
Re: Local Time <AgitatorsBand@yahoo.com>
Re: Local Time <AgitatorsBand@yahoo.com>
Re: Local Time <todd@designsouth.net>
Re: Local Time <bart.lateur@skynet.be>
Re: Local Time (Craig Berry)
Re: Local Time (Craig Berry)
Re: Perl 5.6.1 on AIX 4.3.3 does not pass "make test" (Jens-Uwe Mager)
Re: Re: Is this a (var name/tr) bug, can anyone verify ("Richard Stands")
Re: Re: Is this a (var name/tr) bug, can anyone verify ("Richard Stands")
Retrieving substring with regular expressions <abaker97@yahoo.com>
Re: Retrieving substring with regular expressions (Randal L. Schwartz)
Re: Stripping out VBA Comments <notmyrealemail@example.com>
Re: unicode support in perl 5.6 -- I'm trying to get it <ilya@math.ohio-state.edu>
Re: unicode support in perl 5.6 -- I'm trying to get it <elijah@workspot.net>
weird error on @array syntax <lastnamefirstnameinitial@ornl.gov>
Re: weird error on @array syntax <godzilla@stomp.stomp.tokyo>
Re: weird error on @array syntax (Craig Berry)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 09 May 2001 18:48:44 +0100
From: nobull@mail.com
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <u93dael8g3.fsf@wcl-l.bham.ac.uk>
Dan Sugalski <dan@tuatha.sidhe.org> writes:
> Sure. The order that subexpressions in an expression get evaluated is
> undefined, subject to change, and likely odd due to optimization.
Comming from a C background I intuatively assume this to be true.
However, I'm unable to find where this is stated to be the case for
Perl in the standard POD set.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 09 May 2001 20:16:52 +0200
From: Joerg Behrens <jbehren@gwdg.de>
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <qg1ypyz8tn.fsf@umpp41.gwdg.de>
Dan Sugalski <dan@tuatha.sidhe.org> writes:
>Joerg Behrens <jbehren@gwdg.de> wrote:
>>Having the possibility to encounter an equivalence of $a+0 != $a in the
>>context of integers (occupied by common human interpretation) doesn't really
>>make Perl an intuitive language, IMHO. Use of this feature by mistake might be
>>hard to discover without debugger.
>Well, I don't know exactly how this relates to the original problem,
A slight variation of the original problem is:
$a=1; print( ($a + $a++), "\n");
$a=1; print( ($a + 0 + $a++), "\n");
This gives:
3
2
Which means that in this context you have $a+0 != $a.
>but I don't see that it's something that should be unexpected.
Ok, I need more brain cells to reach your state.
>If you do a "use integer;", or any other pragma, you're changing the
>behaviour of perl. If that changed behaviour is something you find
>difficult to wrap your brain around then don't do that.
I was not precise enough. I did not meant the integer context you get
with "use integer;". I meant the context in my head when i have to do with
simple numbers. The Perl-internal type of the number does not seem to make
any difference here.
>Perl's as intuitive a language as any other I've come across. It just requires
>a different intuition than you might be used to.
Perl is a great language, no question. It is my favourite.
But it also confuses my sometimes. :)
Jörg
------------------------------
Date: Wed, 09 May 2001 19:39:56 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <g2hK6.52620$Ce4.4415143@news1.rdc1.ct.home.com>
Joerg Behrens <jbehren@gwdg.de> wrote:
> Dan Sugalski <dan@tuatha.sidhe.org> writes:
>>Joerg Behrens <jbehren@gwdg.de> wrote:
>>>Having the possibility to encounter an equivalence of $a+0 != $a in the
>>>context of integers (occupied by common human interpretation) doesn't really
>>>make Perl an intuitive language, IMHO. Use of this feature by mistake might be
>>>hard to discover without debugger.
>>Well, I don't know exactly how this relates to the original problem,
> A slight variation of the original problem is:
> $a=1; print( ($a + $a++), "\n");
> $a=1; print( ($a + 0 + $a++), "\n");
> This gives:
> 3
> 2
> Which means that in this context you have $a+0 != $a.
No, it doesn't really. What it means is that the value of $a is
indeterminate within the expression. You should really consider
the variables inside an expression in a mild state of quantum
flux, with their values only collapsing when actually observed.
Which way they collapse can't (or at least shouldn't) necessarily
be predicted.
This isn't strongly documented anywhere, and it probably should be.
>>If you do a "use integer;", or any other pragma, you're changing the
>>behaviour of perl. If that changed behaviour is something you find
>>difficult to wrap your brain around then don't do that.
> I was not precise enough. I did not meant the integer context you get
> with "use integer;". I meant the context in my head when i have to do with
> simple numbers. The Perl-internal type of the number does not seem to make
> any difference here.
The problem is that the context in your head doesn't match perl's context.
You're assuming strict left to right ordering. Perl doesn't assume that.
Dan
------------------------------
Date: Wed, 9 May 2001 20:54:40 +0100
From: "Simon Flack" <news@simonflack.com>
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <9dc7pv$gj9mf$1@ID-83895.news.dfncis.de>
Hi,
I think this is what you are looking for:
> "++" and "--" work as in C. That is, if placed before a
> variable, they increment or decrement the variable before
> returning the value, and if placed after, increment or
> decrement the variable after returning the value.
(from "perlop" under "Auto-incriment" heading)
------------------------------
Date: 09 May 2001 12:52:45 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <m3lmo6pfyq.fsf@dhcp9-172.support.tivoli.com>
On 09 May 2001, jbehren@gwdg.de wrote:
> Having the possibility to encounter an equivalence of $a+0 != $a
> in the context of integers (occupied by common human interpretation)
> doesn't really make Perl an intuitive language, IMHO. Use of this
> feature by mistake might be hard to discover without debugger.
This only comes up when you use $a++ (or its ilk), which are very
non-intuitive. The solution is really the same in Perl as it is in C,
which is to avoid this constructs in anything but the most straight-
forward cases.
The common pitfall of this in C is when calling a macro (perhaps
without even realizing it) that uses its argument more than once. You
end up incrementing the variable twice without realizing it. The
quintessential example is:
#define MAX(a,b) a > b ? a : b
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 09 May 2001 20:53:35 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: basic TRUE / FALSE
Message-Id: <j7iK6.1421$I5.350776@news1.rdc1.tn.home.com>
>
> my $showvar = TRUE;
>
> I can't find anything in the FAQs or docs about use of these things. Can
I
> not use them this way?
>
no, use 0 or 1
-todd
------------------------------
Date: Wed, 09 May 2001 20:50:24 +0200
From: Javier Jara <javier.jara@bb-data.de>
Subject: Connect to another pc.
Message-Id: <3AF99170.24FA9F5C@bb-data.de>
Hi there !
I´m trying to connect a share from another pc with the following
Programm but I really don´t know what is wrong !
Can you tell me that ? Thanks !
---
Xavier
******************************
use Win32::NetResource;
$Password = "";
$UserName = "administrator";
$Connection = 1;
%NETRESOURCE = {
'Scope' => RESOURCE_GLOBALNET,
'Type' => RESOURCETYPE_DISK,
'DisplayType' => RESOURCEUSAGE_CONNECTABLE,
'Usage' => RESOURCEUSAGE_CONTAINER,
'LocalName' => "D\:",
'RemoteName'=> "TEMP",
'Comment'=> "test",
'Provider'=> "PC_01",
};
Win32::NetResource::AddConnection(
\%NETRESOURCE,$Password,$UserName,$Connection);
******************************
------------------------------
Date: Wed, 09 May 2001 21:32:12 GMT
From: "smilepak" <smilepak@hotmail.com>
Subject: Re: Good editor for perl Use Scite !
Message-Id: <wHiK6.1208$8x4.126656@newsread2.prod.itd.earthlink.net>
Use CuteHTML!
"Prévost Christophe" <hayden@club-internet.fr> wrote in message
news:9d7kup$41s$1@front1m.grolier.fr...
> "Super-Simon"
>
> > I'm searching for a good, fast editor with syntax highlighting for perl
> > (CGI) for use under Windows 2000 / Windows 98 (I use windowz only for
> > editing scripts, scripts runs on Linux-server). It has to be free (I'm a
> > poor student ;-)
>
> I'm quite surprise that scite isn't better known...
>
> Scite use Scintilla control like komodo but scite it reallly small. Komodo
> use a lot of memory. Scite is cross platform (Linux / Win32) and really
> customisable. In fact to be really easy to use you may have to customize
it
> (for example to change the position of the output bar, to enable line
> numbers on gutter, enable multiple buffers, customise syntax highligthing
> etc...)
>
> Scite is updated oftently, free... opensource... marvellous... paramount
>
> I use it for php, python and perl...
>
> URL: http://www.scintilla.org
>
>
>
------------------------------
Date: Wed, 09 May 2001 14:56:19 -0500
From: Gary Peek <peek@industrologic.com>
Subject: Re: Invoking Perl script from a web page (graphic/SSI)
Message-Id: <3AF9A0E3.CE717CAC@industrologic.com>
Peter Lowndes wrote:
>
> I have written a perl script to log details about visitors to my company's
> web site. I would like to insert a call to this script at the top of each of
> the pages but don't know how to just call the script as a simple command in
> html or javascript. As a work around I am using the IMG tag to call the perl
> script but it generates errors in the site's transfer log because the script
> doesn't actually return an image. Is there an easy way to return an image
> (one pixel will do) or another syntax that calls the script without
> expecting anything back?
>
> At the moment I have something like this in the html header
>
> <script>
> <!--
> var x
> ..... some javascript to put data into x ....
> file://-->
> </script>
>
> and then this in the body
>
> <script>
> <!--
> document.write('<IMG WIDTH=1 HEIGHT=1 SRC="/cgi-bin/script99.pl?'+x+'">')
> file://-->
> </script>
Similar to Todd Smith's suggestion in calling:
<!--#exec cgi="script.cgi"-->
or
<!--#exec cmd="/path/script.cgi"-->
Some server configurations allow SSI, but only with graphics
returned, not "exec cgi" or "exec cmd". I was forced to use:
In the HTML file:
<img src="/cgi-bin/log.cgi?text">
where "text" is the text I want send to the script, passed using
$ARGV[0] for writing to the log file.
An excerpt for the log script I use is (you will need to change
path and file name of course):
#!/bin/perl
$| = 1; #flush buffer after every print
# send a single pixel transparent gif to satisfy the "img src" SSI
print "Content-type: image/gif\n\n";
$_ =
"47494638396101000100800000000000FFFFFF21F90401000001002C00000000010001000002014C003B";
s/../printf "%c",hex($&)/ge;
print("\n");
open(FILE, ">>pathandfilename"); # read logfile and add entry
flock(FILE,2);
use Socket;
$hostname = gethostbyaddr(inet_aton($ENV{REMOTE_ADDR}),AF_INET);
print FILE "$ENV{'REMOTE_HOST'}, $hostname, $ARGV[0]\n";
close(FILE);
exit;
--
Gary Peek mailto:peek@industrologic.com
Industrologic, Inc. http://www.industrologic.com
(314) 707-8818
------------------------------
Date: Wed, 9 May 2001 20:41:34 +0100
From: "Simon Flack" <news@simonflack.com>
Subject: Re: Invoking Perl script from a web page
Message-Id: <9dc6t6$h2h3u$1@ID-83895.news.dfncis.de>
> Then what you do is open the image as you would a text file and read the
> data and print the data unmodified back out to the browser,
Also use binmode() on the filehandle.
I know it might not be necessary depending on your filesystem, but it won't
hurt what you're doing at all and will make the script more portable.
e.g.:
print "Content-Type: image/gif\n\n";
open IMAGE, "/path/pic.gif";
binmode IMAGE;
print while <IMAGE>;
Simon
------------------------------
Date: Wed, 9 May 2001 16:47:47 -0500
From: Flounder <japh@flashmail.com>
Subject: Re: Invoking Perl script from a web page
Message-Id: <tfjeoqr488la35@corp.supernews.com>
Yeah he is right binmode is a good idea. I didn't even think about it.
Simon Flack wrote:
> > Then what you do is open the image as you would a text file and read the
> > data and print the data unmodified back out to the browser,
>
> Also use binmode() on the filehandle.
>
> I know it might not be necessary depending on your filesystem, but it
> won't hurt what you're doing at all and will make the script more
> portable.
>
> e.g.:
> print "Content-Type: image/gif\n\n";
> open IMAGE, "/path/pic.gif";
> binmode IMAGE;
> print while <IMAGE>;
>
>
> Simon
>
>
>
>
--
--
Flounder
------------------------------
Date: Wed, 09 May 2001 13:11:43 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Is this a (var name/tr) bug, can anyone verify it???
Message-Id: <3AF9A47F.6700C588@stomp.stomp.tokyo>
Richard Stands wrote:
(snipped)
Please consider not posting html enabled postings.
This is not suggested for USENET posts. Not a real
big deal but you may not know what your post looks
like for non-html newsreaders:
<html><DIV>
<DIV>Doh, (groan) I was AATW* this morning. Saw my error but could not stop the
post from... posting. Thanks for helping to clear this up. Back to sleep now I
guess :o(</DIV>
<DIV> </DIV>
<DIV>-Rich</DIV>
<DIV> </DIV>
<DIV>*asleep at the wheel</DIV></DIV><br clear=all><hr>Get your FREE download of
MSN Explorer at <a
href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>
--
Posted from [63.66.71.66] by way of f57.law11.hotmail.com [64.4.17.57]
via Mailgate.ORG Server - http://www.Mailgate.ORG
Incidently, your USENET posting program is FUBAR.
This is evidenced by incorrect use of div tags.
You really only need to post your message once.
Get the picture?
Godzilla!
------------------------------
Date: Wed, 09 May 2001 18:25:59 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: latest stable version of Perl
Message-Id: <tfj2tn7oe3aj10@corp.supernews.com>
Chris Stith (mischief@velma.motion.net) wrote:
: Not that I'd dare to speak for Abigail, but I took it to mean that
: there's no single version of Perl Abigail would consider to be of
: penultimate stability and more fit for production than all other
: versions.
Just for the record, 'penultimate' means 'next to ultimate', or 'next to
last'. It's not a more intense way to say 'ultimate'. Rather the
opposite, actually. Sorry, sore spot of mine...
On the actual versioning issue, I have been using 5.6 in production for
some time without incident. Of course, my coding style is rather
conservative, so I probably avoid the thin ice without being explicitly
aware of doing so.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Wed, 09 May 2001 13:01:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: latest stable version of Perl
Message-Id: <3AF9A235.EB092415@stomp.stomp.tokyo>
Craig Berry wrote:
> Chris Stith wrote:
(snipped)
> : Not that I'd dare to speak for Abigail, but I took it to mean that
> : there's no single version of Perl Abigail would consider to be of
> : penultimate stability and more fit for production than all other
> : versions.
> Just for the record, 'penultimate' means 'next to ultimate', or 'next to
> last'. It's not a more intense way to say 'ultimate'. Rather the
> opposite, actually. Sorry, sore spot of mine...
Well, hmmm... penultimate is more appropriately used to
reference the next-to-last syllable within a word and,
at times, the next-to-last accent within a word. Our
word "penultimate" is language and literary related.
However, when loosely used, penultimate can fit your
definition, although better defined as the next-to-last
in a series of equality items, this is, items of the
same genre, if I may abuse our word genre.
Godzilla!
------------------------------
Date: Wed, 09 May 2001 18:38:40 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: List equality
Message-Id: <tfj3lgicocd27c@corp.supernews.com>
James Gallagher (jimg@dcz.dods.org) wrote:
: Is there an operator or function built into Perl (or a common idiom)
: that tests if two lists are equal? It's not that hard to write, but I
: thought maybe there was something I've overlooked.
For pete's sake, people, READ THE DOCUMENTATION! It's a lot faster and
easier than asking on the list, and will do no long-term damage to your
karma -- which asking FAQs here will *definitely* do.
perldoc -q equal
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: 09 May 2001 13:05:21 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: List equality
Message-Id: <m3heyupfdq.fsf@dhcp9-172.support.tivoli.com>
On Wed, 09 May 2001, jimg@dcz.dods.org wrote:
> Is there an operator or function built into Perl (or a common idiom)
> that tests if two lists are equal? It's not that hard to write, but
> I thought maybe there was something I've overlooked.
Type:
perldoc -q equal
to view the FAQ entry, "How do I test whether two arrays or hashes are
equal?"
Short answer: no, and be aware of deep compare issues
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Wed, 09 May 2001 20:42:38 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Local Time
Message-Id: <2ZhK6.1413$I5.346866@news1.rdc1.tn.home.com>
> So you went and demonstrated that you had richly earned it. Well
> done.
>
Thanks!
------------------------------
Date: Wed, 09 May 2001 20:44:03 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Local Time
Message-Id: <n_hK6.1415$I5.347460@news1.rdc1.tn.home.com>
>
> That's the spirit! Don't accept that you might have made
> a mistake. And certainly don't learn from it. Don't listen
> to the experts. Don't let good programming advice ruin your
> pride and personal prestige. And if they call you a "bad coder",
> it is only because they don't know you personally.
>
> I'm sure.
All he knows is that I use `date` instead 'localtime'. I don't think that
makes me a bad coder. If you do, don't hire me.
But I'm sure you'll want the last word and send another post...
-todd
------------------------------
Date: Wed, 09 May 2001 20:44:49 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Local Time
Message-Id: <5%hK6.1416$I5.347586@news1.rdc1.tn.home.com>
>
> >I really don't think that anybody's credit card info or medical records
> >could be stolen because somebody uses `date` instead of 'localtime'
>
> Let's put it this way: how can you be absolutely 100% sure that the
> "date" program is indeed the harmless system date program, and not
> something malicious installed in your PATH by a hacker?
>
I can't! I guess I won't do that again! Thanks!
-todd
------------------------------
Date: Wed, 09 May 2001 20:47:51 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Local Time
Message-Id: <X1iK6.219$du2.21228@news.shore.net>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
:>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
: Todd> why do you have to be so mean?
: It's not personal. It's simply to show the onlookers that the answer
: is rather pointless *and* harmful,
Yeah, heaven forbid that he should demonstrate another way to do it.
-Art
------------------------------
Date: Wed, 09 May 2001 20:48:56 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: Local Time
Message-Id: <Y2iK6.220$du2.21228@news.shore.net>
Bart Lateur <bart.lateur@skynet.be> wrote:
: Let's put it this way: how can you be absolutely 100% sure that the
: "date" program is indeed the harmless system date program, and not
: something malicious installed in your PATH by a hacker?
How does he know that /usr/bin/perl (or whatever) is really the perl
compiler and not something malicious?
--Art
------------------------------
Date: Wed, 09 May 2001 21:01:20 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Local Time
Message-Id: <AeiK6.1422$I5.354438@news1.rdc1.tn.home.com>
"Scratchie" <AgitatorsBand@yahoo.com> wrote in message
news:X1iK6.219$du2.21228@news.shore.net...
> Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> :>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
>
> : Todd> why do you have to be so mean?
>
> : It's not personal. It's simply to show the onlookers that the answer
> : is rather pointless *and* harmful,
>
> Yeah, heaven forbid that he should demonstrate another way to do it.
>
> -Art
Thanks dude! I'm getting ganged up on over here over nothing!
-todd
------------------------------
Date: Wed, 09 May 2001 21:13:48 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Local Time
Message-Id: <gjcjft8em5hdov23vnv64g2meuhrrtkjt4@4ax.com>
Scratchie wrote:
>Bart Lateur <bart.lateur@skynet.be> wrote:
>
>: Let's put it this way: how can you be absolutely 100% sure that the
>: "date" program is indeed the harmless system date program, and not
>: something malicious installed in your PATH by a hacker?
>
>How does he know that /usr/bin/perl (or whatever) is really the perl
>compiler and not something malicious?
Because write access to that directoy is very limited? You have to be a
very privileged user (generally, root) in order to install a program
there. On average, Joe Hacker won't have those rights. And if he did, he
wouldn't need to trick you in order to get anything bad done.
So, one may assume that a full path to the date program is safe, when it
is in one of these few privileged directories.
--
Bart.
------------------------------
Date: Wed, 09 May 2001 21:26:02 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Local Time
Message-Id: <tfjdfanr7lh721@corp.supernews.com>
Scratchie (AgitatorsBand@yahoo.com) wrote:
: Randal L. Schwartz <merlyn@stonehenge.com> wrote:
: :>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
: : Todd> why do you have to be so mean?
:
: : It's not personal. It's simply to show the onlookers that the answer
: : is rather pointless *and* harmful,
:
: Yeah, heaven forbid that he should demonstrate another way to do it.
Demonstrating awtdi would have been fine (and wouldn't have triggered
criticism, I'll wager) if he had noted the security and other issues
involved. Knowingly posting code which is much less secure than another
equally simple possible implementation, without pointing out that security
problem, is irresponsible. Posting insecure code unknowingly is grounds
for criticism regarding the poster's level of expertise.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Wed, 09 May 2001 21:27:26 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Local Time
Message-Id: <tfjdhu8m0b2e57@corp.supernews.com>
Scratchie (AgitatorsBand@yahoo.com) wrote:
: How does he know that /usr/bin/perl (or whatever) is really the perl
: compiler and not something malicious?
There have been some late nights when I've considered the real
perl compiler to be something malicious...
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: 9 May 2001 19:19:19 GMT
From: jum@anubis.han.de (Jens-Uwe Mager)
Subject: Re: Perl 5.6.1 on AIX 4.3.3 does not pass "make test"
Message-Id: <slrn9fj61o.10a.jum@anubis.han.de>
On 9 May 2001 10:36:03 -0300, Tony Fitzgerald <jaf@unb.ca> wrote:
>I am trying to install latest stable perl on AIX. The make compiles
>cleanly with only a few (I) information messages suggesting additional
>optimization could be obtained using MAXMEM option. Am using the IBM
>compiler (not gcc). The make test, however, reported failures and
>running the "./perl harness" in the ./t directory indicated that perl
>failed 6/258 or was 97.67% "okay" of test scripts, and 21/12601 or
>99.83% ok for subtests. Some of the tests produced core files.
>
>I had similar problems with Perl 5.6.0 on AIX 4.3.2 last summer and
>eventually gave up. The main reason I'm trying to get the new perl
>installed is that the current "production" perl on the system, 5.004_04,
>also mysteriously core dumps on various scripts under seemingly
>unexplainable condtions, i.e. adding a comment to a script can cause a
>previously stable script to become unstable. The exact same scripts
>typically run with no problem whatsoever on various versions of perl on
>various versions of Solaris (from 2.5.1 through 8).
>
>The 5.6.1 perl passes some tests that 5.6.0 failed, fails some that
>5.6.0 failed, fails some new 5.6.1 tests that were not in 5.6.0 and
>fails some that 5.6.0 passed. Out of curiousity, to see whether it is
>the same or a different set of tests that fail, I tried the perl harness
>run again and now the "./perl harness" in the t directory is taking a
>core dump... it ran OK yesterday afternoon.
>
>A reading of postings in these two news groups ove the past two weeks
>has only yielded one message regarding Perl installation problems on AIX
>and that appears to be unrelated, but I will be trying the patch to
>dlopen from Jens-Uwe Mager to see if it makes any difference.
>
>The only suggestion last summer was to contact IBM support and bringing
>the AIX up to date on maintenance made no difference, nor did the later
>upgrade to 4.3.3.
>
>Has anyone managed to get a recent perl to pass its tests on a recent
>AIX? I would like to know just whether it's possible. The production
>perl on the system was originally compiled on AIX 4.3.0 and I'm
>reasonably sure it did pass its tests at the time.
I would suspect that this is compiler related, I did compile perl 5.6.1
and it passed all tests. I used the old xlc 3.1.4.8 to do it, though.
--
Jens-Uwe Mager <pgp-mailto:62CFDB25>
------------------------------
Date: Wed, 9 May 2001 19:17:56 +0000 (UTC)
From: rstands@hotmail.com ("Richard Stands")
Subject: Re: Re: Is this a (var name/tr) bug, can anyone verify it???
Message-Id: <F29Ua8d9Ee4zadTMVwV0000153d@hotmail.com>
<html><DIV>Doh, (groan) I was AATW* this morning. Saw my error but could not stop the post from... posting. Thanks for helping to clear this up. Back to sleep now I guess :o(</DIV>
<DIV> </DIV>
<DIV>-Rich</DIV>
<DIV> </DIV>
<DIV>*asleep at the wheel</DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>
--
Posted from [63.66.71.66] by way of f29.law11.hotmail.com [64.4.17.29]
via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
Date: Wed, 9 May 2001 19:18:58 +0000 (UTC)
From: rstands@hotmail.com ("Richard Stands")
Subject: Re: Re: Is this a (var name/tr) bug, can anyone verify it???
Message-Id: <F57IkUqLpHkatd4gmSk000015a0@hotmail.com>
<html><DIV>
<DIV>Doh, (groan) I was AATW* this morning. Saw my error but could not stop the post from... posting. Thanks for helping to clear this up. Back to sleep now I guess :o(</DIV>
<DIV> </DIV>
<DIV>-Rich</DIV>
<DIV> </DIV>
<DIV>*asleep at the wheel</DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>
--
Posted from [63.66.71.66] by way of f57.law11.hotmail.com [64.4.17.57]
via Mailgate.ORG Server - http://www.Mailgate.ORG
------------------------------
Date: Wed, 9 May 2001 14:57:38 -0500
From: "Alan Baker" <abaker97@yahoo.com>
Subject: Retrieving substring with regular expressions
Message-Id: <NahK6.54702$Cx5.3222967@e420r-sjo3.usenetserver.com>
I'm trying to create a regular expression that returns a substring from a
string using a regular expresssion.
I have the following string:
/basedir/subdir1/subdir2/some_dir/subdir4/filename
I would like to populate a variable with whatever directory is in between
subdir2 and subdir3. The number of directories can change, but I will always
know the name of the preceding and following directories of some_dir.
Thanks for your help,
Alan
------------------------------
Date: 09 May 2001 13:01:45 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Retrieving substring with regular expressions
Message-Id: <m13dae1ec6.fsf@halfdome.holdit.com>
>>>>> "Alan" == Alan Baker <abaker97@yahoo.com> writes:
Alan> I'm trying to create a regular expression that returns a substring from a
Alan> string using a regular expresssion.
Alan> I have the following string:
Alan> /basedir/subdir1/subdir2/some_dir/subdir4/filename
Alan> I would like to populate a variable with whatever directory is in between
Alan> subdir2 and subdir3. The number of directories can change, but I will always
Alan> know the name of the preceding and following directories of some_dir.
$_ = "/basedir/subdir1/subdir2/some_dir/subdir4/filename";
my ($dir) = m{subdir2/(.*?)/subdir3} or die;
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 09 May 2001 21:29:22 GMT
From: "BarryK" <notmyrealemail@example.com>
Subject: Re: Stripping out VBA Comments
Message-Id: <SEiK6.1429$I5.369308@news1.rdc1.tn.home.com>
"Greg Bacon" <gbacon@HiWAAY.net> wrote in message
news:tfg2j81jbfu3b@corp.supernews.com...
> The 11 is because you used = instead of =~ on the last test. How about
> this? ...
Great! Thanks!!
------------------------------
Date: 9 May 2001 18:52:07 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: unicode support in perl 5.6 -- I'm trying to get it to work l
Message-Id: <9dc3kn$s2g$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Eli the Bearded
<elijah@workspot.net>], who wrote in article <eli$0105091323@qz.little-neck.ny.us>:
> $chr1 = "\N{LATIN CAPITAL LETTER J}\N{SKULL AND CROSSBONES}";
> @oct = $chr1 =~ /(.)/g;
> $len = length($chr1);
> $oct = @oct;
> $isutf8 = (utf8 $chr1)? "yes" : "no";
>
> print "CHR 1: $oct bytes, $len chars, in <\$chr1>; is utf8? $isutf8\n";
>
> $chr2 = "Jâ~X| ";
Did you specify the INPUT ENCODING for the file your script is sitting
in? How would Perl know how to interpret these chars? Not mentioning
that you set this through Usenet, so I have no idea what chars were in
your original posting file.
And I have no idea what you are trying to achieve by your $isutf8. I
have no idea what reasonalbe thing the utf8() function may do. The
only reasonable interpretation I may assume is
sub utf8 {1}
And if @oct != $len, then 5.6.1 is still broken indeed, since @oct
should be named @char: there must be no way in Perl to access the
internal representation.
Ilya
------------------------------
Date: 9 May 2001 20:57:35 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: unicode support in perl 5.6 -- I'm trying to get it to work l
Message-Id: <eli$0105091657@qz.little-neck.ny.us>
In comp.lang.perl.misc, Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> Eli the Bearded <elijah@workspot.net>] wrote:
> > $chr1 = "\N{LATIN CAPITAL LETTER J}\N{SKULL AND CROSSBONES}";
> > @oct = $chr1 =~ /(.)/g;
> > $len = length($chr1);
> > $oct = @oct;
> > $isutf8 = (utf8 $chr1)? "yes" : "no";
> >
> > print "CHR 1: $oct bytes, $len chars, in <\$chr1>; is utf8? $isutf8\n";
> >
> > $chr2 = "Jâ~X| ";
>
> Did you specify the INPUT ENCODING for the file your script is sitting
No.
> in? How would Perl know how to interpret these chars? Not mentioning
Obviously it has no definitive way to do so.
> that you set this through Usenet, so I have no idea what chars were in
> your original posting file.
The five octet sequence that is a valid UTF-8 encoding of
"\N{LATIN CAPITAL LETTER J}\N{SKULL AND CROSSBONES}".
> And I have no idea what you are trying to achieve by your $isutf8. I
> have no idea what reasonalbe thing the utf8() function may do. The
> only reasonable interpretation I may assume is
> sub utf8 {1}
It is from Convert::Scalar --
utf8 scalar[, mode]
Returns true when the given scalar is marked as utf8,
false otherwise. If the optional mode argument is
given, also forces the interpretation of the string to
utf8 (mode true) or plain bytes (mode false). The
actual (byte-) content is not changed. The return
value always reflects the state before any
modification is done.
Another reasonable thing for a utf8() function to do would be the
thing done by the utf8_valid() function from Convert::Scalar.
> And if @oct != $len, then 5.6.1 is still broken indeed, since @oct
> should be named @char: there must be no way in Perl to access the
> internal representation.
I don't have 5.6.1 installed, so I cannot test it there.
Elijah
------
just trying to use perl for Unicode things
------------------------------
Date: Wed, 09 May 2001 16:40:19 -0400
From: Srdan Simunovic <lastnamefirstnameinitial@ornl.gov>
Subject: weird error on @array syntax
Message-Id: <3AF9AB32.E34D34E0@ornl.gov>
I have a program that looks like:
#!/usr/local/bin/perl -w
open(PARMS, "inc") || die "$0: inc $!\n";
undef $/;
$str=<PARMS>;
eval $str;
close(PARMS);
print "@a\n";
The "inc" file contains one line:
@a=(1,2,3);
I am getting an error:
../bin/inctest
In string, @a now must be written as \@a at ../bin/inctest line 9, near
"@a"
Execution of ../bin/inctest aborted due to compilation errors.
However the program:
#!/usr/local/bin/perl -w
open(PARMS, "inc") || die "$0: inc $!\n";
undef $/;
$str=<PARMS>;
eval $str;
close(PARMS);
@b=@a;
print "@a\n";
gives:
../bin/inctest
1 2 3
So only thing changed is addition of
@b=@a;
Is it me (more probably) or perl?
Thanks,
Srdan
------------------------------
Date: Wed, 09 May 2001 14:27:25 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: weird error on @array syntax
Message-Id: <3AF9B63D.476BFB86@stomp.stomp.tokyo>
Srdan Simunovic wrote:
(snipped)
> I have a program....
Change your line:
> print "@a\n";
To this line:
print @a, "\n";
Godzilla!
------------------------------
Date: Wed, 09 May 2001 21:35:45 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: weird error on @array syntax
Message-Id: <tfje1h1l5962a2@corp.supernews.com>
Srdan Simunovic (lastnamefirstnameinitial@ornl.gov) wrote:
: I have a program that looks like:
:
: #!/usr/local/bin/perl -w
: open(PARMS, "inc") || die "$0: inc $!\n";
: undef $/;
: $str=<PARMS>;
: eval $str;
: close(PARMS);
: print "@a\n";
:
: The "inc" file contains one line:
: @a=(1,2,3);
:
: I am getting an error:
: ../bin/inctest
: In string, @a now must be written as \@a at ../bin/inctest line 9, near
: "@a"
: Execution of ../bin/inctest aborted due to compilation errors.
I understand this will be downgraded to a warning in some future version.
In brief, the Perl compiler cannot, at compiler time, see any other
reference to @a anywhere in your program, so it leaps to the conclusion
that you are trying to write a literal '@' rather than trying to
interpolate @a. You could correct this problem by doing a 'use vars' or
'our' declaration of @a before the eval, so that the variable will be
recognized as a variable at compile time. Or...
: However the program:
:
: #!/usr/local/bin/perl -w
: open(PARMS, "inc") || die "$0: inc $!\n";
: undef $/;
: $str=<PARMS>;
: eval $str;
: close(PARMS);
: @b=@a;
: print "@a\n";
:
: gives:
: ../bin/inctest
: 1 2 3
...using the variable *as* an unambiguous variable also makes the compiler
recognize it, removing the problem.
: Is it me (more probably) or perl?
I'd actually blame this one more on perl.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 864
**************************************