[17700] in Perl-Users-Digest
Perl-Users Digest, Issue: 5120 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 15 06:05:37 2000
Date: Fri, 15 Dec 2000 03:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976878312-v9-i5120@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 15 Dec 2000 Volume: 9 Number: 5120
Today's topics:
Re: ??newbie: s/// and \r <sue@pennine.com>
Re: a little off topic <schneider@xtewa.de>
ActivePerl 5.6 GPF when use RE /\X/ <johnlin@chttl.com.tw>
Re: ActivePerl 5.6 GPF when use RE /\X/ <josef.moellers@fujitsu-siemens.com>
Re: Ada feature borrowed for Perl?? <no@spam.net>
Re: Dealing with checkboxes and multiple <SELECTS> <tward10@jaguar.com>
Re: FAQ 5.1: How do I flush/unbuffer an output fileha <johnlin@chttl.com.tw>
Help-Perl/Mysql problem <ofuuzo@ub.uit.no>
Re: How can I check for 'shared' variable errors in my nobull@mail.com
Re: installing perl on win98 <tick.toff@spam.com>
Re: installing perl on win98 <lew@businet.co.nz>
Re: IO::Socket - The server will not reply back to the <schneider@xtewa.de>
Re: IO::Socket - The server will not reply back to the <schneider@xtewa.de>
Re: IO::Socket - The server will not reply back to the <schneider@xtewa.de>
Re: IO::Socket - The server will not reply back to the nobull@mail.com
Is a Hash of Arrays possible? <edd@texscene.com>
Newbie Question...What do they mean by build a binary <mikelin6@home.com>
Perl programming <anujm2000@hotmail.com>
Re: Perl programming <mikelin6@home.com>
Re: perl scripts as exe's <johngros@Spam.bigpond.net.au>
Re: Please help with this script! Weird problem (Philip Lees)
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: Problem using Image::Size on a webserver <g.soper@soundhouse.co.uk>
Re: Regex can't be greedy with /(a|ab)/ ? - what would <thisisnotanemailaddress@dtag.de>
Re: Regex can't be greedy with /(a|ab)/ ? <lincmad001@telecom-digest.zzn.com>
Re: Regex can't be greedy with /(a|ab)/ ? <bart.lateur@skynet.be>
Re: scientific notation <eserte@cs.tu-berlin.de>
Re: Statistics for comp.lang.perl.misc (Csaba Raduly)
Re: Use PERL or Java? Which is faster? (Csaba Raduly)
while(m//g) v.s. while(s///g) <johnlin@chttl.com.tw>
Re: while(m//g) v.s. while(s///g) (Philip Lees)
Re: while(m//g) v.s. while(s///g) nobull@mail.com
Re: Why doesn't this work????? (Location: redirection. (Csaba Raduly)
Windows cant recognize the original owner <Alessandro.Augusto@br.bosch.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Dec 2000 02:11:02 -0800
From: Sue Spence <sue@pennine.com>
Subject: Re: ??newbie: s/// and \r
Message-Id: <91cqnm0340@drn.newsguy.com>
In article <141220001909280105%lincmad001@telecom-digest.zzn.com>, Linc says...
>
>In article <91bj8401uem@drn.newsguy.com>, Sue Spence <sue@pennine.com>
>wrote:
>
>> And this matters because...? The names and meanings of most of the
>> first 32 ASCII chars are relics of a bygone era (that I miss very
>> much but hey, life goes on). Newline is a concept, and is not any
>> particular ASCII char (or chars).
>
>My point was that the poster who said that ^J was the only sensible
>choice for newline, was being unduly provincial (and, to borrow your
>word, "kooky"); that, in fact, if anything, it is the least sensible of
>the three most common choices.
>
>It represents a redefinition of a symbol (^J) when another symbol (^M)
>already had the desired meaning and further when the previous meaning
>of ^J got lost in the shuffle, even though it's a useful meaning to
>have included.
>
>I certainly don't expect that the entire Unix world will at this point
>correct the mistake of choosing the wrong character for newline, but I
>do expect Unix backers to refrain from the laughable enterprise of
>telling the rest of us that we got it wrong.
What you SHOULD be objecting to is the ridiculous labels that ALL newline keys
have on them. The key should be labeled 'Newline'. Not Enter, and ESPECIALLY
not Return!
>
>This is a religious argument, and, as always, I am right.[*]
I am an atheist, therefore we cannot be having a religious argument.
>
>[*] except of course when I intentionally screw up just to throw people
>off balance
I'm sure I don't know what you mean.
------------------------------
Date: Fri, 15 Dec 2000 08:35:16 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: a little off topic
Message-Id: <91cl44$eg6$1@nnrp1.deja.com>
> Damn. I read that, but it didn't sink in.
>
> If anyone cares, the crucial point is an undocumented feature of
> the @INC array: If you push a coderef on there (instead of the
> usual string indicating a directory), the code is executed when
> a use statement later tries to load a module from that non-directory.
> It is called with two parameters, the second of which is the
> module name. The rest of Abigail's japh is standard obfuscation,
> sterling work, but nothing extraordinary. The use of eval() serves
> a double purpose: It delays the execution of use() to run-time, so
> there's no fiddling with BEGIN blocks, and it suppresses the error
> message when the modules are not found.
OIC!
Yet I do not understand how people can possibly think of something like
that by just looking at some "by-the-way-mentioned-undocumented-feature-
of-@INC"-document ...
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 15 Dec 2000 17:00:52 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: ActivePerl 5.6 GPF when use RE /\X/
Message-Id: <91cmop$g9g@netnews.hinet.net>
Dear all,
I rarely see Perl cause a General Protection Fault.
The following is it, when I use regular expression /\X/
<Platform WinNT>
C:\>perl -e "$_ = 'a'; print if /\X/"
<General Protection Fault>
C:\>perl -v
This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2000, Larry Wall
Binary build 618 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 21:03:54 Sep 13 2000
Do you have the same situation?
John Lin
------------------------------
Date: Fri, 15 Dec 2000 11:46:01 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: ActivePerl 5.6 GPF when use RE /\X/
Message-Id: <3A39F669.D9FA3D63@fujitsu-siemens.com>
John Lin wrote:
> =
> Dear all,
> =
> I rarely see Perl cause a General Protection Fault.
> The following is it, when I use regular expression /\X/
> =
> <Platform WinNT>
> =
> C:\>perl -e "$_ =3D 'a'; print if /\X/"
> <General Protection Fault>
> =
> C:\>perl -v
> =
> This is perl, v5.6.0 built for MSWin32-x86-multi-thread
> (with 1 registered patch, see perl -V for more detail)
> =
> Copyright 1987-2000, Larry Wall
> =
> Binary build 618 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 21:03:54 Sep 13 2000
> =
> Do you have the same situation?
No, but then:
josef@tuks:~ > perl -v
This is perl, version 5.005_03 built for i586-linux
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
Date: Fri, 15 Dec 2000 08:44:11 GMT
From: "Misanthrope" <no@spam.net>
Subject: Re: Ada feature borrowed for Perl??
Message-Id: <vRk_5.5127$UN1.489925@newsread2.prod.itd.earthlink.net>
"Jeff Robertson" <jeff_robertson@yahoo.com> wrote in message
news:91b4dp$734$1@nnrp1.deja.com...
> In article <91b37a$61h$1@nnrp1.deja.com>,
> Richard Lawrence <ralawrence@my-deja.com> wrote:
> >
> > Having done Ada for 2 years and Perl for about a year I'm ashamed to
> > admit I have no idea what that feature is. Granted I haven't touched
> > Ada in 5 years and granted i'm not that great at Perl or Ada but can
> > anyone tell me what on earth it was that was borrowed??
>
> Packages ?
>
I don't think so. Ada took that idea from Pascal and/or Modula 2 and/or
Clu.
------------------------------
Date: Fri, 15 Dec 2000 07:56:00 -0000
From: "Trevor Ward" <tward10@jaguar.com>
Subject: Re: Dealing with checkboxes and multiple <SELECTS>
Message-Id: <91ciqg$3908@eccws12.dearborn.ford.com>
The multiple selects are sent back as an array so load these into a perl
array and that should solve your problem.
Adam Levenstein <cleon42@my-deja.com> wrote in message
news:91bg6l$h56$1@nnrp1.deja.com...
> Hey all,
>
> As I'm working on this project, I notice that my CGI script (Perl 5,
> UNIX) is only returning the last value selected with multiple
> checkboxes and <SELECT MULTIPLE> fields. Any way to get around this?
>
> Thanks,
>
> Adam
>
> --
> -------------------------------------------------
> Adam Levenstein
> cleon42@my-deja.com
>
> "Extraordinary claims require extraordinary evidence."
> -- Carl Sagan
>
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
Date: Fri, 15 Dec 2000 09:27:14 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: FAQ 5.1: How do I flush/unbuffer an output filehandle? Why must I do this?
Message-Id: <91bs65$7ie@netnews.hinet.net>
> select((select(OUTPUT_HANDLE), $| = 1)[0]);
I remember there was a discussion concluding that
"The evaluating order of a list is not predictable."
That is, the above expression may be evaluated in
two possible sequences:
select(OUTPUT_HANDLE);
$| = 1;
select((...)[0]);
or
$| = 1;
select(OUTPUT_HANDLE);
select((...)[0]);
The latter is inappropriate. So I suggest to remove this line.
John Lin
------------------------------
Date: Fri, 15 Dec 2000 11:03:47 +0100
From: ofuuzo <ofuuzo@ub.uit.no>
Subject: Help-Perl/Mysql problem
Message-Id: <3A39EC83.A31CC23@ub.uit.no>
Hello,
I am new in the world of perl/Mysql. I wrote my first perl/mysql script
where data are inserted from an html form and send it to a perl script
that would write it to a mysql database. It is working. When I view the
data using mysql command, it shows the following:
mysql> select * from test;
+------------------------------------+------+
| Name | Age |
+------------------------------------+------+
| . Test
. Testing testing
. test | 777 |
+------------------------------------+------+
1 row in set (0.00 sec)
But when I call (view) the same data via perl on the browser, it appears
on the same line like this;
Name Age
. Test . Testing testing . test 777
I am not sure how to separate the data so that it would appear on the
browser like this:
Name Age
. Test
. Testing testing
. test 777
Thanks in advance!
- Ofuuzo
------------------------------
Date: 15 Dec 2000 08:37:12 +0000
From: nobull@mail.com
Subject: Re: How can I check for 'shared' variable errors in my Perl CGI?
Message-Id: <u9zohy3qzu.fsf@wcl-l.bham.ac.uk>
"Philip P. Obbard" <pobbard@hotresponse.com> writes:
> Now, if I do a "perl -cw myscript.cgi" on this file, no errors will be
> found. If I run the CGI through Apache, all will go fine.
> BUT if I run the same CGI under an Apache directory configured for mod_perl
> [Wed Dec 13 09:50:31 2000] myscript.cgi: Variable "@params" will not stay
> shared at /web/myscript.cgi line 9.
> How can I do something akin to "perl -cw myscript.cgi" that
> will ALSO flag "shared variables" errors?
The problem arrises because mod_perl compiles your whole script as a
subroutine, so you can simply do the same:
( echo -n "sub blah_de_blah { "; cat myscript.cgi; echo "}" ) | perl -cw
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 15 Dec 2000 09:06:40 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: installing perl on win98
Message-Id: <Aal_5.18770$xW4.150123@news-server.bigpond.net.au>
ActivePerl and Win98PWS works fine, just takes a small reg hack to associate
your web.doc.extension to perl (or does the way I did it :)
Trevor Ward wrote in message <91cih7$39910@eccws12.dearborn.ford.com>...
>I have setup the local server quite easily, www.perl.com follow link to
>windows version of perl and download. It installs and runs nicely. For a
>server environment I went for OmniHTTP which is a very good web server.
>Tried apache and IIS or PWS but couldn't get the functionality working.
>
>Be aware that omnihttp is about $80 for a full license. But well worth it.
>
>Richard Leclair <leclair@iinet.net.au> wrote in message
>news:3A39B682.7A3D27D@iinet.net.au...
>>
>> I have written perl CGIs on my ISP (linux) with no problems, but I'd
>> like to test stuff locally on my machine, and someone said that I could
>> set up like a local server running ActivePerl.
>>
>> Does anyone know how I go about doing this?
>>
>> Any info would be helpful. Cheers.
>> mailto:leclair@iinet.net.au?subject=perl_on_win98
>>
>>
>> Richie !
>>
>
>
------------------------------
Date: Fri, 15 Dec 2000 22:41:38 +1300
From: "Lew" <lew@businet.co.nz>
Subject: Re: installing perl on win98
Message-Id: <gIl_5.399$XSP.8519839@news.xtra.co.nz>
Active Perl and Apache and MySQL installed on my Win 98 - works magic.
Now I easily write and test all CGI scripts before uploading to server.
Good idea to install Perl in directories /usr/bin/perl on your PC so you
won't have to alter scripts when uploading.
Lew.
Richard Leclair <leclair@iinet.net.au> wrote in message
news:3A39B682.7A3D27D@iinet.net.au...
>
> I have written perl CGIs on my ISP (linux) with no problems, but I'd
> like to test stuff locally on my machine, and someone said that I could
> set up like a local server running ActivePerl.
>
> Does anyone know how I go about doing this?
>
> Any info would be helpful. Cheers.
> mailto:leclair@iinet.net.au?subject=perl_on_win98
>
>
> Richie !
>
------------------------------
Date: Fri, 15 Dec 2000 08:47:16 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: IO::Socket - The server will not reply back to the client
Message-Id: <91clqj$etm$1@nnrp1.deja.com>
> for(<IN>) { print $socket $_; }
AFAIK you need to send a newline here:
for(<IN>) { print $socket $_ . "\n"; }
Yep, now it runs on my machine ...
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 15 Dec 2000 09:17:03 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: IO::Socket - The server will not reply back to the client
Message-Id: <91cnid$g2m$1@nnrp1.deja.com>
> > for(<IN>) { print $socket $_; }
> AFAIK you need to send a newline here:
Normally it should be sending the newline anyway, because you read it
from the file, but maybe you have just one line of text in that file?!?
At least that is what I asumed, and with the newline the code runs on
my machine ... !
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 15 Dec 2000 09:38:36 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: IO::Socket - The server will not reply back to the client
Message-Id: <91coqs$gu3$1@nnrp1.deja.com>
> Yep, now it runs on my machine ...
Oh, I just looked over the code again and found that I modified one
more thing:
You need to send an info, that tells the server that it now should
print to $client instead of reading from it. For example send a double
newline or a single "." or something like that. At the moment you are
just reading all the time ...
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 15 Dec 2000 08:46:46 +0000
From: nobull@mail.com
Subject: Re: IO::Socket - The server will not reply back to the client
Message-Id: <u94s0658dp.fsf@wcl-l.bham.ac.uk>
rzilavec@tcn.net (Richard Zilavec) writes:
> # client
> for(<IN>) { print $socket $_; }
> my $response = <$socket>;
> # server
> @in = <$client>;
> print $client "I got the file\n";
The client forgot to do $socket->shutdown(1) when it finishes writing
so the list context <$client> operator in the server script never
completes.
BTW: This really has nothing to do with Perl. You may like to look on
the net for the socket programming FAQ. I don't know if this is
covered there but it's well worth a look before you first try any
socket programming in any language.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 15 Dec 2000 09:58:55 -0000
From: "Edd" <edd@texscene.com>
Subject: Is a Hash of Arrays possible?
Message-Id: <3a39e95c@news-uk.onetel.net.uk>
Is it possible to have hash of arrays. I am trying to build up of a database
of records consisting of 8-10 fields. What is the best way of doing this. I
thought of using an hash of arrays, each member of the hash will have a
scalar key and an array of 8-10 items.
Also, I have a list of records in an excel file. Is it possible to read
these into a perl data file.
Help would be appreciated.
Edd.
------------------------------
Date: Fri, 15 Dec 2000 09:59:25 GMT
From: Mike Lin <mikelin6@home.com>
Subject: Newbie Question...What do they mean by build a binary
Message-Id: <3A39ED0B.E1250964@home.com>
I've seen this mentioned several times on the perl and apache websites.
Why do you have to build software. I know that when you make C++
programs you have to "build" or "compile" them to make them
executables. Is this what build means regarding building the binary
from source in apache and perl? Do you build it so that it becomes an
install file?
Thanks
Mike Lin
------------------------------
Date: Fri, 15 Dec 2000 08:30:05 -0000
From: Anuj <anujm2000@hotmail.com>
Subject: Perl programming
Message-Id: <t3jlkdmaeoku6a@corp.supernews.com>
Hello,
I am a beginner in perl programming.I work on win98. I have downloaded
the perl interpertor from www.activestate.com & installed it in c:\perl.
The main perl.exe file path is C:\perl\bin\perl.exe . I write a perl file
(.pl) in a program which i downloaded called perl scripting tool. I know
that to run scripts i need the .pl file to be reffered to the perl
interpreter. In the DOS prompt i have to write "PATH=/perl/bin" always
before running the script and then writing the initializing command
i.e "perl hello.pl" ( An example file hello.pl) . Is there a way that i
dont need to always write the PATH=/perl/bin command so that i can
directly run the scripts from the DOS prompt by typing "perl hello.pl". If
so please reply me.Can you please tell me some web sites realted to perl
that provide information for beginners?
Thank You
Anuj
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: Fri, 15 Dec 2000 10:20:04 GMT
From: Mike Lin <mikelin6@home.com>
Subject: Re: Perl programming
Message-Id: <3A39F1E2.710709E8@home.com>
say anuj, this can be done by setting the path in the config.sys or
autoexec.bat (I forget which..) You type something like set path=c:\perl\ or
just add this path to whatever default path is already in the config.sys or
autoexec.bat file. Look it up in the DOS help on how to set paths for more
details.
Hey I actually helped someout!
Mike Lin
Anuj wrote:
> Hello,
> I am a beginner in perl programming.I work on win98. I have downloaded
> the perl interpertor from www.activestate.com & installed it in c:\perl.
> The main perl.exe file path is C:\perl\bin\perl.exe . I write a perl file
> (.pl) in a program which i downloaded called perl scripting tool. I know
> that to run scripts i need the .pl file to be reffered to the perl
> interpreter. In the DOS prompt i have to write "PATH=/perl/bin" always
> before running the script and then writing the initializing command
> i.e "perl hello.pl" ( An example file hello.pl) . Is there a way that i
> dont need to always write the PATH=/perl/bin command so that i can
> directly run the scripts from the DOS prompt by typing "perl hello.pl". If
> so please reply me.Can you please tell me some web sites realted to perl
> that provide information for beginners?
> Thank You
> Anuj
>
> --
> Posted via CNET Help.com
> http://www.help.com/
------------------------------
Date: Fri, 15 Dec 2000 09:14:08 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: perl scripts as exe's
Message-Id: <Ahl_5.18783$xW4.150391@news-server.bigpond.net.au>
Found it!, perlfaq3 manpage, reading it I think I might not bother.
> I have seen it somewhere in the docs once but I have been cruising the
docs
------------------------------
Date: Fri, 15 Dec 2000 08:43:07 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Please help with this script! Weird problem
Message-Id: <3a39d8d7.3038028@news.grnet.gr>
On Thu, 14 Dec 2000 21:05:13 GMT, Mike Lin <mikelin6@home.com> wrote:
>I mentioned this because somebody wrote that I should print out the error
>message but I don't get anything except a generic browser error message
>everytime my script doesn't work.
If you use Carp any fatal error messages your script generates will be
sent to the browser.
use CGI;
use CGI::Carp qw( fatalsToBrowser );
You can also use the CGI module to create the html headers and so on
for you, without coding them explicitly.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Fri, 15 Dec 2000 09:54:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <9gqj3tolbrtvvmumk1u12dhj61a0960058@4ax.com>
Tad McClellan wrote:
>Bart Lateur <bart.lateur@skynet.be> wrote:
>>But now these will be published guidelines. People ignoring these
>>guidelines deserve all the flames they get.
>
>
>But we are not _required_ to give them what they deserve.
>
>We should, in fact, encourage folks to _not_ give them what
>they deserve.
>
>It would be nice if this newsgroup was, well... nicer.
>(that sounds really strange considering the source...)
I'm all for that. Nice is nice.
And I didn't mean that they SHOULD get what they deserve. Only, that
they really don't have much to complain about, if they get it on their
heads.
--
Bart.
------------------------------
Date: Fri, 15 Dec 2000 09:57:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <flqj3tkfj60agk7n7k78c0s6oseo48otpl@4ax.com>
Tad McClellan wrote:
>>Doesn't your newsreader allow you to ignore threads containing articles
>>of certain authors?
> ^^^^^^^
>
>How would he know what authors are going to followup to the post?
He doesn't have to.
My newsreader allows me to ignore WHOLE THREADS based upon the
properties of just one post of one contribuant. The other posts are
ignored by inference, based upon their "references" header.
--
Bart.
------------------------------
Date: Fri, 15 Dec 2000 00:27:07 +0000 (GMT)
From: Geoff Soper <g.soper@soundhouse.co.uk>
Subject: Re: Problem using Image::Size on a webserver
Message-Id: <4a2d0501d2g.soper@soundhouse.co.uk>
In article <976744359.28205@itz.pp.sci.fi>,
Ilmari Karonen <iltzu@sci.invalid> wrote:
> What happened when you tried it? (rhetorical question)
I'm very skepical of assuming if something work that it's OK without
knowing so. I like to know something is working in the correct, intended
way.
--
Geoff Soper
g.soper@soundhouse.co.uk
Take a look at the Soundhouse page http://www.soundhouse.co.uk/
------------------------------
Date: Fri, 15 Dec 2000 10:42:39 +0100
From: Patrick Stein <thisisnotanemailaddress@dtag.de>
Subject: Re: Regex can't be greedy with /(a|ab)/ ? - what would happen if they were ?
Message-Id: <91cp2f$qhu$01$1@news.t-online.com>
Thanx all for the ideas, I didn't much know of the difference of POSIX NFAs
style regexec compared to Perl's until yesterday :v) I always thought that
perl does build a trie ( not tree ) to get high performance regex. It would
be no problem to always return the largest match then without any performance
degradation.
As many of you suspected I'm building regexes automatically including
variable length patterns so that the sorting does not work. The only solution
in perl seems now the suggested "while( $stringToSearch =~ $regex ){.." which
in my case will be too slow.
So my next question is, if someone would hack a new style | regex into perl
would it break older programs ? - I think not but my vision might be limited
to regexes I usually work with.
An extension like '(?lLa|ab)' ( questionmark lowercase L ( ongest ) ) should
always be backward compatible right ?
Thanx for the replys - Patrick
--
keep on moving - jolly
===================================================================
Patrick Stein or Jolly at jinx dot de
===================================================================
" Parents of organic life forms are warned that towels can be
harmful, if swallowed in large quantities." douglas adams
===================================================================
------------------------------
Date: Fri, 15 Dec 2000 01:51:37 -0800
From: Linc Madison <lincmad001@telecom-digest.zzn.com>
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <151220000151371398%lincmad001@telecom-digest.zzn.com>
In article <91c8fs$4i7$1@nnrp1.deja.com>, Quantum Mechanic
<quantum_mechanic@my-deja.com> wrote:
> > There's a note in the Camel book that some systems may generate
> > fatal errors if you have a sort order that is not always
> > well-defined.
>
> Yes, but the note is intended for sort arguments that do not compare
> the same way every time, as in:
>
> @result = sort { 1 - rand(3) } @list;
>
> where each ($a,$b) ordered pair will not always generate the same
> result because of rand. But a sort has to be able to handle equality,
> as in:
>
> @list = ( 'a', 'a', 'a' );
> @result = sort @list;
>
> Consider...it is conceivable that the lexical order is not important,
> only the length, or perhaps some other function on the elements of
> @list.
Hmm. I hadn't ever considered the possibility of a sort function that
returned different results for two invocations on the same pair of
elements. When would such a thing ever be desirable?
(Of course, I also wasn't thinking about the case of having identical
elements, which obviously a sort has to be able to accommodate.)
I was holding my sort function to a higher-than-necessary standard,
specifically that it should produce the same output ordering,
irrespective of the input ordering. That's what I think of in terms of
a "well-defined sort."
For instance:
sub basicsort { length($b) <=> length ($a) }
sub oversort { length($b) <=> length ($a) or $a cmp $b }
my @in1 = qw( def abc ghi cba );
my @in2 = qw( cba ghi abc def ); # same elem's, diff. order
my @out1b = sort basicsort @in1;
my @out1o = sort oversort @in1;
my @out2b = sort basicsort @in2;
my @out2o = sort oversort @in2;
I take it that sorting using "basicsort" is adequate to prevent a core
dump, even though @out1b is not the same as @out2b, because you will
always get the same comparison between two elements.
------------------------------
Date: Fri, 15 Dec 2000 10:02:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regex can't be greedy with /(a|ab)/ ?
Message-Id: <juqj3t0f2kq4rqga0ff95vl5v66etrj613@4ax.com>
Linc Madison wrote:
>A minor point, but I'd make the sort expression
>
> @alt = sort { length($b) <=> length($a) or $a cmp $b } @alt;
>
>just in case you have something like
>
> @alt = qw(a ab abc cab bac);
>
>(or in any event somehow resolve the ordering of strings of equal
>length).
There's no need. The intent is to create an alternatives pattern, like
(abc|cab|bac|ab|a)
or
(cab|bac|abc|ab|a)
It doesn't matter. /(abc|bac)/ and /(bac|abc)/ match the same things.
So, both patterns will match the same thing, for all possible cases.
--
Bart.
------------------------------
Date: 15 Dec 2000 09:57:59 +0100
From: Slaven Rezic <eserte@cs.tu-berlin.de>
Subject: Re: scientific notation
Message-Id: <87n1dyjc2w.fsf@vran.herceg.de>
"Harley Green" <ep@w3dzine.net> writes:
> correction its a NumEntryPlain widget.
Can you send $Tk::NumEntryPlain::VERSION and a short sample script?
Regards,
Slaven
--
use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s!\n!!g;map{create$c 'line'=>
map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split''}split"!";$x+=12}split/_/=>'K
PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+
KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop
------------------------------
Date: Fri, 15 Dec 2000 10:27:22 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <Xns900B6C9FAquuxi@194.203.134.135>
And so it came to pass that abigail@foad.org (Abigail) on 08 Dec 2000
wrote <slrn9328da.nl1.abigail@tsathoggua.rlyeh.net>:
[snip]
>++ Now that Abigail seems to use nearly only ++ as a quote prefix,
>she's ++ dropped quite a bit in the OCR scale (number 7) -- though I
>note that ++ being number 9 is not so hot, either. (On the other
>hand, I'm probably ++ not doing much to improve my score with this
>post.)
>
Abigail, could you please lose the ++ as a quote prefix ? My quote
regex is too hairy and has too many false positives already. Please use
the "standard" quote prefix ( > ).
>
>OCR is a stupid rating. It strongly suggest that asking questions,
>even if they are off-topic or FAQs is a good thing, while answering
>questions in a concise way is bad.
>
A usefulness rating would be much more helpful, of course. If only
there was a simple way to compute it...
>
>The OCR should be removed from the statistics.
>
Why ? It's a statistic. As long as it's treated with the respect a
statistic deserves (none :), there shouldn't be any problem.
>
>Abigail
>
>
>OCR filler OCR filler OCR filler OCR filler OCR filler OCR filler
[snip]
You almost overdid it. I used to have a 100-line limit on articles.
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
You are in a maze of twisted little minds, all different.
------------------------------
Date: Fri, 15 Dec 2000 10:16:34 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <Xns900B6FFBFquuxi@194.203.134.135>
And so it came to pass that "BarryNL" <wiz@hogwarts.edu> on 12 Dec
2000 wrote <917d9m$5cq$4@nereid.worldonline.nl>:
>"Sunil Matta" <smatta@acm.org> wrote in message
>news:90lvji$jv9$1@nnrp1.deja.com...
>> No comparison. Perl is blindingly fast. Java is slow.
>
>Er, don't you have that the wrong way round. If you think Java is
>slow I suggest looking at something like the Java ZX Spectrum
>emulator which runs about 4x the speed of the real thing on a
>Pentium III.
>
Or at (one of the many) ZX emulators written in C, which run 10x faster
(so they need a slowdown parameter) on a Pentium 100.
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
You are in a maze of twisted little minds, all different.
------------------------------
Date: Fri, 15 Dec 2000 10:23:02 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: while(m//g) v.s. while(s///g)
Message-Id: <91bvei$bgo@netnews.hinet.net>
Dear all,
For the following program
$_ = "1 2 3 4 5";
while(m/\d/g) { print "matching $&\n" }
__END__
matching 1
matching 2
matching 3
matching 4
matching 5
how can I do the same thing on s/// ?
$_ = "1 2 3 4 5";
while(s/\d/0/g) { print "replacing $&\n" }
__END__
replacing 5
replacing 0
...
(I want "replacing 1, replacing 2 ... replacing 5".)
Thank you.
John Lin
------------------------------
Date: Fri, 15 Dec 2000 09:29:51 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: while(m//g) v.s. while(s///g)
Message-Id: <3a39e2d2.5593643@news.grnet.gr>
On Fri, 15 Dec 2000 10:23:02 +0800, "John Lin" <johnlin@chttl.com.tw>
wrote:
> $_ = "1 2 3 4 5";
> while(s/\d/0/g) { print "replacing $&\n" }
>
>__END__
>replacing 5
>replacing 0
>...
>
>(I want "replacing 1, replacing 2 ... replacing 5".)
while(s/(\d)//) { print "replacing $1\n" }
Or replace the digit with some other character:
while(s/(\d)/x/) { print "replacing $1\n" }
Replacing each digit with zero results in a never-ending loop, since
zero matches the \d.
See perlre for more.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: 15 Dec 2000 08:51:36 +0000
From: nobull@mail.com
Subject: Re: while(m//g) v.s. while(s///g)
Message-Id: <u93dfq573d.fsf@wcl-l.bham.ac.uk>
"John Lin" <johnlin@chttl.com.tw> writes:
> For the following program
> while(m/\d/g) { print "matching $&\n" }
Recieved wisdom is that you shouldn't use $&, enclose the regex in ()
and use $1.
while(m/(\d)/g) { print "matching $1\n" }
For reason see perlvar description of $&. Actually I'm not sure if
this is still applicable in 5.6 since 5.6 introduces @- and @+ which
AFAIK exist always after a match and hence the "don't bother to record
the information needed to implement $& et al" optomisation surely
can't apply. Does anyone here know for sure?
> how can I do the same thing on s/// ?
> while(s/\d/0/g) { print "replacing $&\n" }
Use the s///eg operator as your the loop control structure:
s{(\d)}{ print "replacing $1\n"; 0 }eg;
You don't have to use {} delimiters, you can still use /// but IMHO
readbility goes down the toilet if you do. The stuff in the second {
} is not parsed according to normal block parsing rules so if it's non
trivial I suggest moving it out to a subroutine.
sub replacement { print "replacing $1\n"; 0 }
s/(\d)/replacement/eg;
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 15 Dec 2000 10:51:32 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: Why doesn't this work????? (Location: redirection....)
Message-Id: <Xns900B65D1Cquuxi@194.203.134.135>
And so it came to pass that me on 09 Dec 2000 wrote
<3a318836.28060974@nntp.interaccess.com>:
>I have been having problems with my perl scripts on a linux server...
>
>For redirection: here's a script that will not work (it works on
>another server I use with FreeBSD)
>
>
>#!/usr/local/bin/perl
>
>print "Location: http://www.cnn.com/\n\n";
>
>That's it.... It runs fine in telnet, but I always get "premature end
>of script headers" when I try to execute it through Apache server...It
>works fine on my FreeBSD installation.
>
Look at error_log and (if error_log only has "premature end") cgi_log.
>
>I'm assuming it's something set up incorrectly with the Apache Web
>Server, but other scripts seem to work fine (but only when I use CGI
>and it's commands, not normal print "text/html", etc.)
>
This is a CGI question. Followups set.
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
You are in a maze of twisted little minds, all different.
------------------------------
Date: Fri, 15 Dec 2000 08:46:04 -0200
From: Alessandro Augusto <Alessandro.Augusto@br.bosch.com>
Subject: Windows cant recognize the original owner
Message-Id: <3A39F66B.91EE4157@br.bosch.com>
I found a Windows weakness with the ownership. I havenīt heard anything
about
it, so let me try to explain.
Supose this:
c:\home\user1
c:\home\user2
c:\home\...
Now, suppose that user1, a normal user, who is the owner of directory
"c:\home\user1" removed the permissions (ACE) of the administrator. So
the administrator cant change
any permission on this directory.
The only way I found , being the administrator, to change the
permissions of this
directory, is taking the ownership of it. But when I do that, it mess up
with the
older permissions. Also, when I try to take the ownership, Windows does
not
recognize the original owner.
How can I find a better solution to that?
Have any one seen this before?
Thanks
Alessandro
Ps. I posted this message to comp.lang.perl cause, I found this during a
test
of my perl script which apply ACLs to files. If the user removed the
administrator
ACE, my script cant change the permissions.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 5120
**************************************