[13515] in Perl-Users-Digest
Perl-Users Digest, Issue: 925 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 27 20:07:22 1999
Date: Mon, 27 Sep 1999 17:05:14 -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: <938477113-v9-i925@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 27 Sep 1999 Volume: 9 Number: 925
Today's topics:
Re: Advice wanted: Creating an .exe <emschwar@rmi.net>
Before I leave, one more comment. <Webmaster@copscorp.com>
Re: gullible programmers? <ltl@rgsun5.viasystems.com>
Re: gullible programmers? <Webmaster@copscorp.com>
Re: gullible programmers? (David H. Adler)
Re: gullible programmers? <flavell@mail.cern.ch>
How to minimize to systray on WIN9X <torsten.knoefel@gmx.de>
Re: Installation Problem!!!! <rootbeer@redcat.com>
Re: LOL, please don't overanalyze :) <mike@crusaders.no>
Re: LOL, please don't overanalyze :) (brian d foy)
Match and escape processing Brett.A.Hunsaker@usace.army.mil
Re: Match and escape processing (brian d foy)
Re: Match and escape processing rabm@prodigy.net
Re: Match and escape processing <ltl@rgsun5.viasystems.com>
Re: Perl 5.005_03, BerkeleyDB 2.7.7, BerkeleyDB-0.06, a <trevor@ndl.net>
Problem with eval and lexical scoping (Cody Jones)
Re: Problem with eval and lexical scoping (Kragen Sitaker)
Re: Randomize array..... <skilchen@swissonline.ch>
Re: Randomize array..... <cassell@mail.cor.epa.gov>
Re: Randomize array..... <skilchen@swissonline.ch>
Re: remove the html tag in the file (Randal L. Schwartz)
Re: remove the html tag in the file <dan@tuatha.sidhe.org>
Re: retrieving Win32 File Versions <blazer@mail.nevalink.ru>
Re: Slice in scalar context (Greg Bacon)
Re: Slice in scalar context (Greg Bacon)
Re: Slice in scalar context <uri@sysarch.com>
using system() on perl for NT <pauls@pauls.seanet.com>
Re: using system() on perl for NT (Kragen Sitaker)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Sep 1999 16:58:05 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Advice wanted: Creating an .exe
Message-Id: <xkf905shshu.fsf@valdemar.col.hp.com>
"William" <bivey@teamdev.com> writes:
> Problem2: Some of customer's installations use an older
> Perl (5.003_07) and don't appear to have LWP
> installed.
>
> Solution2: Create a stand-alone executable using a script
> that does what's needed and perlapp or some such.
How about
Solution3: Get customer to install a version of perl that's not several
years old, and not ridden with CERT advisories, bugs, and other, um,
"hidden features". As a side effect, this will include the LWP module,
thus saving you much time & effort. If customer is recalcitrant, mention
liability incurred by running software with known bugs and security
problems. Also mention happy-fun-nifty new features included in modern
Perls.
Or even
Solution4: Distribute a copy of lynx, and a batch file that essentially
does a "lynx -dump <URL>". Save much time & trouble.
> Here's where the advice request comes in. Is there
> anything wrong with that solution that I don't see?
It unnecessarily increases size and distribution costs. It's also
pointless to duplicate Perl interpreters and support libraries and
modules if it's even remotely possible to avoid.
-=Eric
------------------------------
Date: Mon, 27 Sep 1999 18:39:42 -0400
From: "Eric Seiler" <Webmaster@copscorp.com>
Subject: Before I leave, one more comment.
Message-Id: <XnSH3.159$AH1.189811@news.abs.net>
Eric Bohlman wrote in message <7sop62$ln3@dfw-ixnews5.ix.netcom.com>...
>Eric Seiler (Webmaster@copscorp.com) wrote:
>: I think some people are confused, and think I am here to take other
people's
>: time, and return nothing - that is completely false. I believe in
keeping
>: the key players around, and will offer whatever I can, at the time, to do
>: so. I'm not asking for investors - I'm asking for people to help grow a
>: business. If the business is a success then no doubt the pay plan will
>: change, but if it is a failure then we will all be looking for something
>: else and I will be the only one to lose money.
>
>Excuse me. You're asking for people to help grow a business by
>contributing something that carries monetary value (i.e. time) to it, but
>you're not asking for investors? What other definition of "investor" is
>there?
>
>: I find this whole discussing fascinating though, and I hope you continue
to
>: respond. If you were in my situation, with very little capital (enough to
>: take care of the web account, some pre-written apps, etc.), no desire to
>: take out a loan (too risky when it is the Internet), a great idea, but
needs
>: people willing to work with him, what terms would you offer them? Oh, I
also
>: need to mention that I am only a partner in the company that has
supported
>: this thus far; Therefore, I cannot extend partnership to someone else,
>: without the consent of everyone else. Interesting situation, isn't it?
So
>: what would you do? What form of agreement would you use that would be
fair
>: to everyone involved?
>
>I'd incorporate, with the stock initially owned by myself and my
>partners, and would offer a substantial share (a majority position, or
>close to it) of that stock to the programmer, along with real information
>(not hype or wishfull thinking) as to why this venture is going to be able
>to go public in the near future.
>
>If you've noticed that under this scenario you and your partners would
>not retain full control of the company, you're very perceptive. That's
>the price you have to pay to raise capital from other people.
The business that I am in is not dependent on myself acquiring a programmer.
Finding one in this situation would be a great advantage, but I can just
wait for my current revenue stream to broaden to the point where I can
justify hiring a programmer. No skin off of my back, now I understand why
you seemed so skeptical. I am trying to find people to help with the ONLINE
portion of my business. I would be insane to offer those terms to anyone in
my situation, but I guess you just don't really know what my position is.
LOL, I guess finding investors would be a good idea if I was in that
situation, fortunately I am not.
Eric Seiler
Cops, Inc.
>
>
------------------------------
Date: 27 Sep 1999 22:29:13 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: gullible programmers?
Message-Id: <7sor3p$2m1$1@rguxd.viasystems.com>
Eric Seiler <Webmaster@copscorp.com> wrote:
:>Quite frankly I feel like this is Salem, and I am on trial. What is up with
:>you guys anyway? Do people come through here regularly with spam scams or
:>something? I'm not trying to sell anything, but when someone doubts my
:>motivations I feel it is necessary to respond.
I didn't question your motivations. I just questioned your ability
to make a profit.
You *are* trying to sell something. You are asking that someone invest
their time (price) for potential future reward (product). If you
really expect to sell this, then you need to work on your pitch.
I'm with that movie character that says "show me the money," because
until you do, I can assume that you are full of crap, and I'll be
right at least 99.9% of the time.
It's true that there are many anecdotal stories of people who have
made huge gobs of money by following someone's dream (their own or
someone elses), but the truth is that the vast majority of them
fail. I doubt that I (or most people) have the ability to sort
the winners from the losers. So though you may be perfectly sincere
in your belief that this could be a good opportunity for someone,
it looks like a sucker's bet to me.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Mon, 27 Sep 1999 18:54:49 -0400
From: "Eric Seiler" <Webmaster@copscorp.com>
Subject: Re: gullible programmers?
Message-Id: <NBSH3.160$AH1.190371@news.abs.net>
Nah, its okay. I understand, but I thought people would contact me if they
were interested, not blast my ideas if they weren't. No biggie, I think I
found someone anyway (PHP not perl) so this entire thread may be a moot
point. Personal contacts are the best way to get people anyway - they can
at least vouch for you.
Eric Seiler
Cops, Inc.
lt lindley wrote in message <7sor3p$2m1$1@rguxd.viasystems.com>...
>Eric Seiler <Webmaster@copscorp.com> wrote:
>
>:>Quite frankly I feel like this is Salem, and I am on trial. What is up
with
>:>you guys anyway? Do people come through here regularly with spam scams or
>:>something? I'm not trying to sell anything, but when someone doubts my
>:>motivations I feel it is necessary to respond.
>
>I didn't question your motivations. I just questioned your ability
>to make a profit.
>
>You *are* trying to sell something. You are asking that someone invest
>their time (price) for potential future reward (product). If you
>really expect to sell this, then you need to work on your pitch.
>
>I'm with that movie character that says "show me the money," because
>until you do, I can assume that you are full of crap, and I'll be
>right at least 99.9% of the time.
>
>It's true that there are many anecdotal stories of people who have
>made huge gobs of money by following someone's dream (their own or
>someone elses), but the truth is that the vast majority of them
>fail. I doubt that I (or most people) have the ability to sort
>the winners from the losers. So though you may be perfectly sincere
>in your belief that this could be a good opportunity for someone,
>it looks like a sucker's bet to me.
>
>--
>// Lee.Lindley /// I used to think that being right was everything.
>// @bigfoot.com /// Then I matured into the realization that getting
>//////////////////// along was more important. Except on usenet.
------------------------------
Date: 27 Sep 1999 19:22:01 -0400
From: dha@panix.com (David H. Adler)
Subject: Re: gullible programmers?
Message-Id: <slrn7uvv0p.h2r.dha@panix.com>
On Mon, 27 Sep 1999 17:47:48 -0400, Eric Seiler
<Webmaster@copscorp.com> wrote:
>Quite frankly I feel like this is Salem, and I am on trial. What is up with
>you guys anyway?
Actually, I'm kind of surprised that no one has come down on you for
putting a job posting here. It's quite off-topic.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Well, sure, being a ruthless godless dictator is fun, but it's all
about the fans!"
- Public Broadcast of His Imperial Majesty, Dimension 431-q-fhd
------------------------------
Date: Tue, 28 Sep 1999 01:26:36 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: gullible programmers?
Message-Id: <Pine.HPP.3.95a.990928012224.25098B-100000@hpplus03.cern.ch>
On Mon, 27 Sep 1999, Eric Seiler wrote:
> Quite frankly I feel like this is Salem, and I am on trial.
Quite frankly, I for one witnessed you trying to take the hon. Usenauts
for suckers, and they called you on it.
Cope with it.
Oh look, and you posted with the MS-approved stigmata too. Ho hum.
It's been a long September, as Abigail never tires of reminding us.
[jeopardy clutter now mercilessly excised]
------------------------------
Date: Mon, 27 Sep 1999 22:33:40 GMT
From: Torsten Knoefel <torsten.knoefel@gmx.de>
Subject: How to minimize to systray on WIN9X
Message-Id: <7sorc4$151$1@nnrp1.deja.com>
I've one questions:
How can I write a program in perl (win32) that is able to minimize to
the systray ?
(I use Active Perl)
Regards,
--
Torsten Knoefel
Managing Director
e-trend
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 27 Sep 1999 15:14:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Installation Problem!!!!
Message-Id: <Pine.GSO.4.10.9909271513110.26916-100000@user2.teleport.com>
On Mon, 27 Sep 1999, Lance Stallcop wrote:
> I'm trying to install Perl 5.005_03. I downloaded stable.tar.gz and
> followed the instructions from there. I ran Configure and checked all
> the questions I was asked, everything looked normal. Configure wrote
> the config.sh file and gave me the opportunity to edit the file or
> press return. I pressed return, next thing I know my machine is
> counting the RAM and rebooting!
If you were building it as root, try again; you don't need to be root to
build perl. (But you should be root to install it in the system
directories, of course.)
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 28 Sep 1999 00:31:48 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: LOL, please don't overanalyze :)
Message-Id: <BfSH3.768$A_5.4343@news1.online.no>
Eric Seiler <Webmaster@copscorp.com> wrote in message
news:WpQH3.155$AH1.184903@news.abs.net...
> As for yahoo - it was started by two guys with little money. If a person
> has the drive, motivation, and talent to help me make this into the next
> yahoo, then I will offer them terms on the gross revenue of the venture.
I
Ah - but Yahoo already had a product when they started the company. Yahoo
started out as a spare-time project by a two students, and when they
realized they could actualy make money off it, they founded their company.
--
Trond Michelsen
------------------------------
Date: Mon, 27 Sep 1999 18:55:28 -0400
From: brian@pm.org (brian d foy)
Subject: Re: LOL, please don't overanalyze :)
Message-Id: <brian-ya02408000R2709991855280001@news.panix.com>
In article <BfSH3.768$A_5.4343@news1.online.no>, "Trond Michelsen" <mike@crusaders.no> posted:
> Eric Seiler <Webmaster@copscorp.com> wrote in message
> news:WpQH3.155$AH1.184903@news.abs.net...
> > As for yahoo - it was started by two guys with little money. If a person
> > has the drive, motivation, and talent to help me make this into the next
> > yahoo, then I will offer them terms on the gross revenue of the venture.
> I
>
> Ah - but Yahoo already had a product when they started the company. Yahoo
> started out as a spare-time project by a two students, and when they
> realized they could actualy make money off it, they founded their company.
Yahoo was started by two guys who didn't have to beg others to help
them program. working for free on your own ideas is a lot different
then working for free on other people's ideas.
if you work on other people's stuff, get paid. plenty of people are
looking for Perl programmers, so there's no need not to get compensation.
either way, Perl Mongers has a couple of lists that deal with this:
http://www.pm.org/mailing_lists.shtml
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Mon, 27 Sep 1999 22:02:29 GMT
From: Brett.A.Hunsaker@usace.army.mil
Subject: Match and escape processing
Message-Id: <7sophe$vql$1@nnrp1.deja.com>
A simple question - I would think the following statement would always
be true:
$xyz =~ m/$xyz/
But if the string contains a backslash, it returns false. Can someone
explain what is happening?
Thanks.
$xyz = 'C:\\DOSFILE.TXT';
print "Hi!\n" if ( $xyz =~ m/$xyz/ );
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 27 Sep 1999 19:03:19 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Match and escape processing
Message-Id: <brian-ya02408000R2709991903190001@news.panix.com>
In article <7sophe$vql$1@nnrp1.deja.com>, Brett.A.Hunsaker@usace.army.mil posted:
> A simple question - I would think the following statement would always
> be true:
>
> $xyz =~ m/$xyz/
>
> But if the string contains a backslash, it returns false. Can someone
> explain what is happening?
the match operater does double-quotish interpolation. if there is a
blackslash in the string, then the interpolation treats that as an
escape of the following character, rather than as a backslash. then,
since the backslash is part of the literal string, but not the pattern,
it can't match.
you can stop this sort of thing like so
$xyz =~ m/\Q$xyz/;
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 27 Sep 1999 19:04:03 -0400
From: rabm@prodigy.net
Subject: Re: Match and escape processing
Message-Id: <uu2og3qjg.fsf@prodigy.net>
>>>>> "Brett" == Brett A Hunsaker <Brett.A.Hunsaker@usace.army.mil> writes:
Brett> A simple question - I would think the following statement would always
Brett> be true:
Brett> $xyz =~ m/$xyz/
Brett> But if the string contains a backslash, it returns false. Can someone
Brett> explain what is happening?
Brett> Thanks.
Brett> $xyz = 'C:\\DOSFILE.TXT';
Brett> print "Hi!\n" if ( $xyz =~ m/$xyz/ );
This doesn't seem so simple: I ran it with -Dr (regular expression
debugging) and it looks like the slash is doing funky things. The parser
seems to be looking at part of the variable.
E:\howto>perl -Dr -e "$xyz = 'C:\\DOSFILE.TXT'; print qq(Hi!\n) if $xyz =~ \
/${xyz}/; print qq(DEBUG: $xyz\n)
Omitting $` $& $' support.
EXECUTING...
Compiling REx `C:\DOSFILE.TXT'
size 10 first at 1
rarest char F at 2
1: EXACT <C:--¦,?>(3)
3: NDIGIT(4)
4: EXACT <OSFILE--¦??>(7)
7: REG_ANY(8)
8: EXACT <TXT-¦>(10)
10: END(0)
anchored `OSFILE' at 3 (checking anchored) minlen 13
Guessing start of match, REx `C:\DOSFILE.TXT' against `C:\DOSFILE.TXT'...
Found anchored substr `OSFILE' at offset 4...
Guessed: match at offset 1
Matching REx `C:\DOSFILE.TXT' against `:\DOSFILE.TXT'
Setting an EVAL scope, savestack=3
1 <C> <:\DOSFILE.T> | 1: EXACT <C:--¦,?>
DEBUG: C:\DOSFILE.TXT
Freeing REx: `C:\DOSFILE.TXT'
.
$xyz = 'C:\\DOSFILE.TXT';
E:\howto>perl -Dr -e "$xyz = 'C:/DOSFILE.TXT'; print qq(Hi!\n) if $xyz =~ \
/${xyz}/; print qq(DEBUG: $xyz\n);
Omitting $` $& $' support.
EXECUTING...
Compiling REx `C:/DOSFILE.TXT'
size 8 first at 1
rarest char F at 6
1: EXACT <C:/DOSFILE--¦??>(5)
5: REG_ANY(6)
6: EXACT <TXT-¦>(8)
8: END(0)
anchored `C:/DOSFILE' at 0 (checking anchored) minlen 14
Guessing start of match, REx `C:/DOSFILE.TXT' against `C:/DOSFILE.TXT'...
Found anchored substr `C:/DOSFILE' at offset 0...
Guessed: match at offset 0
Matching REx `C:/DOSFILE.TXT' against `C:/DOSFILE.TXT'
Setting an EVAL scope, savestack=3
0 <> <C:/DOSFILE.T> | 1: EXACT <C:/DOSFILE--¦??>
10 </DOSFILE> <.TXT> | 5: REG_ANY
11 </DOSFILE.> <TXT> | 6: EXACT <TXT-¦>
14 </DOSFILE.TXT> <> | 8: END
Hi!
DEBUG: C:/DOSFILE.TXT
Freeing REx: `C:/DOSFILE.TXT'
Brett> Sent via Deja.com http://www.deja.com/
Brett> Before you buy.
--
Vinny Murphy
------------------------------
Date: 27 Sep 1999 22:49:01 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Match and escape processing
Message-Id: <7sos8t$2m1$2@rguxd.viasystems.com>
Brett.A.Hunsaker@usace.army.mil wrote:
:>A simple question - I would think the following statement would always
:>be true:
:>$xyz =~ m/$xyz/
Why would you think that?
:>But if the string contains a backslash, it returns false. Can someone
:>explain what is happening?
:>$xyz = 'C:\\DOSFILE.TXT';
:>print "Hi!\n" if ( $xyz =~ m/$xyz/ );
If the string contained a backslash or any other character
that is a regular expression metacharacter, then you aren't comparing
what you think you are comparing.
perldoc perlre
will probably confuse you, but read it anyway. Skip ahead to the
section on "Version 8 Regular Expressions" before you get too bogged
down in the (?...) extensions and the discussion on backtracking.
Then look at the quotemeta() function.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Mon, 27 Sep 1999 19:38:17 -0400
From: Trevor Williams <trevor@ndl.net>
Subject: Re: Perl 5.005_03, BerkeleyDB 2.7.7, BerkeleyDB-0.06, and Solaris7
Message-Id: <37EFFFE9.F7E988A7@ndl.net>
I did not have any luck with solving the Solaris7 problem so
I down-shifted and re-installed Solaris 2.6 and everything
works now. Apparently there are some changes to Solaris7
that I need to checkup on... Thanx for the pointer to the
testers web site...
Trevor W.
TgW ;^{>
Elaine -HFB- Ashton wrote:
> [ courtesy cc to original author ]
> Trevor Williams wrote:
> > Hi,
> >
> > Has anyone successfully installed the above combination and gotten
> > it to work?
>
> I have all of the above and got the same output from your code. I did
> notice that BerkeleyDB.pm failed all of the t/unknown tests. I ran a
> truss of the program too and didn't notice anything terribly odd so it
> is possible that something is not quite right somewhere in there. What
> version of gcc and patchlevel?
>
> http://testers.cpan.org/search?request=dist&dist=BerkeleyDB shows all of
> the platforms currently tested for this module.
>
> e.
------------------------------
Date: 27 Sep 99 22:43:29 GMT
From: ua025@vtn1.victoria.tc.ca (Cody Jones)
Subject: Problem with eval and lexical scoping
Message-Id: <37eff311.0@news.victoria.tc.ca>
According to the perlsub man page, "An eval()... can see the
lexical variables of the scope it is being evaluated in so long as the
names aren't hidden by declarations within the eval() itself."
However, the following program fails to run:
#!/usr/bin/perl -w
use strict;
my $outer_eval = '{ my $x = 1; eval \'print $x\'; }';
eval $outer_eval;
It fails with the error "Global symbol "x" requires explicit package name
at (eval 2) line 1." I am using 5.004_04. The second eval is being
executed in the same scope as "my $x = 1", so why can't it see $x?
Please send any replies by e-mail. Thanks!
CDWJ
--
------------------------------
Date: Mon, 27 Sep 1999 23:29:38 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problem with eval and lexical scoping
Message-Id: <C5TH3.2416$J66.270534@typ11.nn.bcandid.com>
In article <37eff311.0@news.victoria.tc.ca>,
Cody Jones <ua025@vtn1.victoria.tc.ca> wrote:
> #!/usr/bin/perl -w
> use strict;
> my $outer_eval = '{ my $x = 1; eval \'print $x\'; }';
> eval $outer_eval;
>
>It fails with the error "Global symbol "x" requires explicit package name
>at (eval 2) line 1." I am using 5.004_04. The second eval is being
>executed in the same scope as "my $x = 1", so why can't it see $x?
This program outputs '1' on 5.005_03.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 27 1999
42 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 27 Sep 1999 22:30:30 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Randomize array.....
Message-Id: <aeSH3.19472$m4.76921868@news.magma.ca>
Michael de Beer <madebeer@igc.apc.org> wrote in:
newws:APC&1'0'50775dc5'5d3@igc.apc.org...
>
> You should know that the most of your questions will be answered in
> the documentation and FAQs.
>
> >and i encountered a problem on
> >randomize the array elements and put the result into another array...
>
> This, for example, is a FAQ. To read the excellent answers,
>
But one question is not answered in perlfaq4:
How random is the shuffling of arrays with (lets guess) more than 15
elements, using the builtin rand()?
Some hints or pointers to hints would be very welcome.
------------------------------
Date: Mon, 27 Sep 1999 16:33:48 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Randomize array.....
Message-Id: <37EFFEDC.E69D71E2@mail.cor.epa.gov>
Samuel Kilchenmann wrote:
[snip]
> But one question is not answered in perlfaq4:
> How random is the shuffling of arrays with (lets guess) more than 15
> elements, using the builtin rand()?
> Some hints or pointers to hints would be very welcome.
Oddly enough, it 'looks' fairly random. The Fisher-Yates
algorithm in the FAQ is a good choice of algorithm [what a
surprise, like tom is going to choose a loser algorithm to
stick in his FAQ]. And the pseudo-random number generator
seems to work pretty well for me. I.e., as I evaluated it,
the rand() call passed the basic tests I tried.
[BTW: This is perl, version 5.005_03 built for sun4-solaris]
Of course, it is not truly random, and I haven't seen a
computer program which *provably* generated random numbers.
I even have my doubts about Math::TrulyRandom [as well as
the C code it is based on].
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 27 Sep 1999 23:49:06 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Randomize array.....
Message-Id: <SnTH3.19484$m4.76966811@news.magma.ca>
David Cassell <cassell@mail.cor.epa.gov> wrote in:
news:37EFFEDC.E69D71E2@mail.cor.epa.gov...
> Samuel Kilchenmann wrote:
> [snip]
> > But one question is not answered in perlfaq4:
> > How random is the shuffling of arrays with (lets guess) more than
15
> > elements, using the builtin rand()?
> > Some hints or pointers to hints would be very welcome.
>
> Oddly enough, it 'looks' fairly random. The Fisher-Yates
> algorithm in the FAQ is a good choice of algorithm [what a
> surprise, like tom is going to choose a loser algorithm to
> stick in his FAQ]. And the pseudo-random number generator
> seems to work pretty well for me. I.e., as I evaluated it,
> the rand() call passed the basic tests I tried.
> [BTW: This is perl, version 5.005_03 built for sun4-solaris]
>
Ok, but isn't there a fundamental problem that the number of possible
permutations grows so fast, that typical pseudo-random generators
(which - as far as i know - have all an upper limit of possible
pseudo-random sequences) will select a particular shuffle with - lets
say - equal probability?
How is Perl's rand() seeded? If it uses a 32-bit seed value, then i
assume that the shuffling of arrays with more than a few elements will
not be very random. Is this a wrong assumption?
------------------------------
Date: 27 Sep 1999 16:14:44 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: remove the html tag in the file
Message-Id: <m14sgghrq3.fsf@halfdome.holdit.com>
>>>>> "Dan" == Dan Sugalski <dan@tuatha.sidhe.org> writes:
Dan> Sure, why not? :)
Dan> Of course, then you have to ask yourself--when racing the heat death of
Dan> the universe, who'd win, your script or the universe? ;-P
I'll presume the joke here, because I don't see why a properly
constructed regex would be any slower than a fairly mechanically
constructed recursive-descent parser.
print "Just another Perl hacker,"
--
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: Mon, 27 Sep 1999 23:55:38 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: remove the html tag in the file
Message-Id: <_tTH3.1896$Af7.36495@news.rdc1.ct.home.com>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Dan" == Dan Sugalski <dan@tuatha.sidhe.org> writes:
> Dan> Sure, why not? :)
> Dan> Of course, then you have to ask yourself--when racing the heat death of
> Dan> the universe, who'd win, your script or the universe? ;-P
> I'll presume the joke here, because I don't see why a properly
> constructed regex would be any slower than a fairly mechanically
> constructed recursive-descent parser.
Sorry, old joke. I'm pretty sure you could construct a regex such that
doing this:
$src =~ s/$c_compiler_regex/$c_compiler_subs/g;
would take $src (as C, or any other, source) and compile it down to an
object module. (It wouldn't surprise me if you could do it without Ilya's
code extensions. I have this nagging feeling that the regex engine is
turing complete even without them) The question, of course, is 'how
long'...
Dan
------------------------------
Date: Tue, 28 Sep 1999 03:25:46 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Guy Corngood <guy@eschland.com>
Subject: Re: retrieving Win32 File Versions
Message-Id: <37EFFCFA.78C045E1@mail.nevalink.ru>
Guy Corngood wrote:
>
> Newbie Question:
>
> Is it possible to grab the File Version of a file on a Win32 platform with
> Perl? Is this ability built into to Perl or is there a module out there
> that will make this possible? I have been unable to locate any info on
> this...
>
> Thanks
> -guy
Take a look at Win32::File::Ver at my site - if you are speaking about binary version resource in .exe, .dlls etc - then this module can do this.
--
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================
------------------------------
Date: 27 Sep 1999 22:57:08 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Slice in scalar context
Message-Id: <7soso4$84f$3@info2.uah.edu>
In article <MPG.125969b028bf0458989fe8@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) writes:
: True. But you forgot to share your favorite kludge to get the number of
: elements in the slice:
:
: $right = () = ("fred","barney","wilma")[0,1,2];
Tim didn't ask. What method to compute the same would you consider to be
unkludgelich?
Greg
--
File names are infinite in length where infinity is set to 255 characters.
-- Peter Collinson
------------------------------
Date: 27 Sep 1999 23:00:18 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Slice in scalar context
Message-Id: <7sosu2$84f$4@info2.uah.edu>
In article <x71zbk14df.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> writes:
: >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
:
: LR> True. But you forgot to share your favorite kludge to get the
: LR> number of elements in the slice:
:
: LR> $right = () = ("fred","barney","wilma")[0,1,2];
:
: now that is as fine a wast of code as i have seen in a while. you have a
: constant list for the index of the slice and then you need to count the
: length of the list? even it the list was an array that would be dumb.
Constant lists change. Consider the idiomatic C code
int array[] = { 1, 2, 4, 8, 16, 32, 64, };
int powers = sizeof(array) / sizeof(array[0]);
It's written this way for maintainability. The same is true of the
"fine waste of code" that Larry submitted.
: also the () in counting the number of elements in a list makes sense,
: but just counting the number of elements in a slice makes little
: sense.
Really? Can you prove that it will never be useful?
: you can just count the number of elements in the index list since
: you are going to discard the sliced values by assigning to ().
What if the number of indices in the slice list changes?
Greg
--
Please, Lord, let me prove that winning the lottery won't spoil me.
------------------------------
Date: 27 Sep 1999 19:35:02 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Slice in scalar context
Message-Id: <x7r9jkylll.fsf@home.sysarch.com>
>>>>> "GB" == Greg Bacon <gbacon@ruby.itsc.uah.edu> writes:
GB> In article <x71zbk14df.fsf@home.sysarch.com>,
GB> Uri Guttman <uri@sysarch.com> writes:
GB> : >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
GB> :
GB> : LR> True. But you forgot to share your favorite kludge to get the
GB> : LR> number of elements in the slice:
GB> :
GB> : LR> $right = () = ("fred","barney","wilma")[0,1,2];
GB> :
GB> : now that is as fine a wast of code as i have seen in a while. you have a
GB> : constant list for the index of the slice and then you need to count the
GB> : length of the list? even it the list was an array that would be dumb.
GB> Constant lists change. Consider the idiomatic C code
GB> int array[] = { 1, 2, 4, 8, 16, 32, 64, };
GB> int powers = sizeof(array) / sizeof(array[0]);
perl doesn't have that. arrays ne lists. why would you want to count a
CONSTANT list and not use the list again? in perl it is useless to do
that. a constant list used as a slice makes sense but to count the
results of that slice is just wasting your cpu as the results of the
slice are discarded.
GB> It's written this way for maintainability. The same is true of the
GB> "fine waste of code" that Larry submitted.
in the above line of code. how are the values of fred, barney and wilma
ever going to be used again? they are lost to the ether, my friend. it
is pining for the bit bucket. it has been garbage collected. it is an
ex-list!
GB> : also the () in counting the number of elements in a list makes sense,
GB> : but just counting the number of elements in a slice makes little
GB> : sense.
GB> Really? Can you prove that it will never be useful?
because the values returned by the slice are thrown away by the (). so
you might as well count the slice indexes. but that is silly too if the indexes
are a list of constants. because again they are only in that one
expression and must be cut and pasted to be used elsewhere. can you say
"bug waiting to happen"?
GB> : you can just count the number of elements in the index list
GB> since : you are going to discard the sliced values by assigning to
GB> ().
GB> What if the number of indices in the slice list changes?
you still throw away data waste computation. remember you have a ()
there and no assignment of the slice or its indexes. so you might as
well assign a scalar constant to the variable and remove the list
code. the constant list can't be used again so why count it. and if the
index list is constant, having it in slice and then counting it is a
waste. you might as well assign it to an array since you might want the
indexes later on. then counting it is trivial.
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: Mon, 27 Sep 1999 16:04:03 -0700
From: Paul Spitalny <pauls@pauls.seanet.com>
Subject: using system() on perl for NT
Message-Id: <37EFF6BC.EB7BA4D2@pauls.seanet.com>
Hi,
I have perl v5.004 via "mks toolkit." I'm using it on NT 4.0 with
service pack # 5.
In previous days, on my win95 machine, I'd run perl code from the MS-DOS
prompt. In lots of my perl scripts I'd use:
system();
to run another perl script from within the first one. example; I'd have
a line like the following:
system(fred filename):
this line would run the file fred.pl using the file "filename" as it's
argument. But now, I can't get that to happen. I suspect it's because
"fork()" is not working. Has anyone out there have any run-arounds for
this problem?
much appreciated!
Paul
------------------------------
Date: Mon, 27 Sep 1999 23:31:14 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: using system() on perl for NT
Message-Id: <67TH3.2419$J66.272095@typ11.nn.bcandid.com>
In article <37EFF6BC.EB7BA4D2@pauls.seanet.com>,
Paul Spitalny <pauls@pauls.seanet.com> wrote:
>system(fred filename):
>
>this line would run the file fred.pl using the file "filename" as it's
>argument. But now, I can't get that to happen.
What happens instead? If you're running this in a Unix environment
like MKS, perhaps . is not in your path and fred is in your current
directory. Or perhaps you're forgetting to put the .pl on the end of
the filename of the script.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Mon Sep 27 1999
42 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
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 925
*************************************