[26415] in Perl-Users-Digest
Perl-Users Digest, Issue: 8586 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 29 21:05:30 2005
Date: Sat, 29 Oct 2005 18:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 29 Oct 2005 Volume: 10 Number: 8586
Today's topics:
Re: Access a c++ module from Perl <sisyphus1@nomail.afraid.org>
FAQ 4.35 How do I find the soundex value of a string? <comdog@pair.com>
Re: Microsoft Hatred FAQ <timr@probo.com>
Performance & Perl robic0@yahoo.com
Re: Performance & Perl <nobody@bigpond.com>
Re: Performance & Perl xhoster@gmail.com
Re: Timelocal input, post good Date filters (from - to) robic0@yahoo.com
Re: Timelocal input, post good Date filters (from - to) robic0@yahoo.com
windows program return values vs perl return values fro <Fred@fred.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 Oct 2005 09:49:20 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Access a c++ module from Perl
Message-Id: <4363fcaf$0$8220$afc38c87@news.optusnet.com.au>
"bg-greece" <temporary@mail.gr> wrote in message
news:djl9aa$16vn$1@ulysses.noc.ntua.gr...
> In fact Win32::API was the first try and it also produced segmentation
> fault.Other trivial examples however (with kernel32.dll for example) have
> worked.
>
Those dll's that are working were built using the stdcall calling
convention. I suggest building your dll using the same calling convention -
there's a command line switch that does that for you. (I think it's '/Gz' -
but check 'cl /?')
There exists somewhere a patched version of Win32::API that will work with
cdecl calling convention, but I don't think that patched version has been
ported to Cygwin.
Cheers,
Rob
------------------------------
Date: Sat, 29 Oct 2005 22:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@pair.com>
Subject: FAQ 4.35 How do I find the soundex value of a string?
Message-Id: <dk0ril$99r$1@reader2.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
4.35: How do I find the soundex value of a string?
(contributed by brian d foy)
You can use the Text::Soundex module. If you want to do fuzzy or close
matching, you might also try the String::Approx, and Text::Metaphone,
and Text::DoubleMetaphone modules.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Sat, 29 Oct 2005 18:34:49 GMT
From: Tim Roberts <timr@probo.com>
Subject: Re: Microsoft Hatred FAQ
Message-Id: <jvf7m1tlcdmmmb50bnfa5rh5q3o7qhanlm@4ax.com>
"David Schwartz" <davids@webmaster.com> wrote:
>Paul Rubin wrote:
>
>> "David Schwartz" <davids@webmaster.com> writes:
>
>>> To call it an "established legal fact" is to grossly distort the
>>> circumstances under which it was determined and upheld.
>
>> Who is paying you to post such nonsense?
>
> That's basically slander.
Slander is spoken. When it's written down like this, it's libel.
Slander/spoken start with S, libel/literature start with L.
Normally, I would never post such a trivial correction, but I thought it
was quite appropriate to throw yet another completely useless fact into
this completely useless thread, which was started by a completely useless
troll.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
------------------------------
Date: Sat, 29 Oct 2005 15:54:18 -0700
From: robic0@yahoo.com
Subject: Performance & Perl
Message-Id: <pdu7m1thrpavnktc0ejohf4rkk8u68smua@4ax.com>
Or C?
(Disclaimer: I have not delved into the Perl source)
How close does Perl follow C as far as primatives?
Can I rely on Perl language constructs to follow C when
writing performance code?
In a runtime race will a Perl for loop time exactly the same as a
C for loop? When the race begins, if not, why not?
Any divergence in stack processing Perl to C?
Is there such a thing as a Perl "temporary" on the stack?
Why would I need to care about any of this on a "higher level"
language, or is Perl a higher level language?
------------------------------
Date: Sat, 29 Oct 2005 23:11:22 GMT
From: Gregory Toomey <nobody@bigpond.com>
Subject: Re: Performance & Perl
Message-Id: <43640198@news.comindico.com.au>
robic0@yahoo.com wrote:
> Or C?
>
> (Disclaimer: I have not delved into the Perl source)
>
> How close does Perl follow C as far as primatives?
> Can I rely on Perl language constructs to follow C when
> writing performance code?
Like comparing apples & oranges.
C is compiled & is not garbage collected, Perl 5 "interprets" a parse tree &
is garbage collected.
gtoomey
------------------------------
Date: 29 Oct 2005 23:14:22 GMT
From: xhoster@gmail.com
Subject: Re: Performance & Perl
Message-Id: <20051029191422.405$WW@newsreader.com>
robic0@yahoo.com wrote:
> Or C?
>
> (Disclaimer: I have not delved into the Perl source)
>
> How close does Perl follow C as far as primatives?
Um, not at all. Perl primitives are scalar, self-resizing arrays,
and hashes. C primitives are floats, doubles, ints, bytes, etc, and
primitive arrays.
> Can I rely on Perl language constructs to follow C when
> writing performance code?
I have no idea what that means.
>
> In a runtime race will a Perl for loop time exactly the same as a
> C for loop?
No. A C for loop won't even time *exactly* the same as a C for loop.
>When the race begins, if not, why not?
Why would they?
>
> Any divergence in stack processing Perl to C?
I'm not exactly sure what that means, but I'm pretty sure the
answer is yes.
>
> Is there such a thing as a Perl "temporary" on the stack?
>
> Why would I need to care about any of this on a "higher level"
> language,
Um, I don't know. Why is purply my favorite color?
> or is Perl a higher level language?
Higher than what? C? Yes.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Sat, 29 Oct 2005 14:38:09 -0700
From: robic0@yahoo.com
Subject: Re: Timelocal input, post good Date filters (from - to)
Message-Id: <eho7m113p00gt4vr05lnqo489fqrjj2bev@4ax.com>
On Fri, 28 Oct 2005 10:56:47 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:
>anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in news:djsvbj$ess$3
>@mamenchi.zrz.TU-Berlin.DE:
>
>> <robic0@yahoo.com> wrote in comp.lang.perl.misc:
>>
>>> About the __DATA__ thing, I thought it was a flag to ignore below as
>>> comments, but thats where I put the output. Whats the right way
>>> to do it?
>>
>> Bell's ringing. Off to the docs!
>
>Indeed.
>
>The OP can start by reading the posting guidelines:
>
> Also provide example input data for your program. If you
> need to show file input, use the __DATA__ token (perldata.pod)
> to provide the file contents inside of your Perl program.
>
>Sinan
The trouble is your abbrv's aren't in the posting guidelines.
I don't know what OP is. I don't think that you know the context
of guidelines. You may want to suggest improvements to the OP
code if its relavent to their topic, but not to the extent of
exlusivity and divergence from the OP intent from which they
started the thread. Otherwise, English composition teachers
might have a voice in this group.
If instead, perhaps you would like to contribute more than
an English teacher to the OP intent your suggestion's would
attract more attention that not.
I know there's brilliant regulars who post follow-ups in
this group. One would read the guidelines and conclude
the narrowness precludes abstract and creative largest
thinking. Unless you are content, and wish to restrict
you skill to 1 line programs, you might want to open
your mind and imagine the world of programing as being
abstract, creative and most of all inclusive.
You should temper your "anal retentive, close to psycotic"
madness, with something that shows others, yes indeed you
are human!
I'm starting to think this is a perpetual Perl intro class
with brilliant masters trolling for a quick "gotcha" fix
to ease their need for revenge when they were butt-fucked
by a family uncle in their youth. This is metaphorical of
course, it could have been their father's, brother's or
neighbor. Its a psycho-sexual dysfunction exibited by
some, copied by others.
Good day gentlemen.
PS. bells ringing, it will again I'm sure
------------------------------
Date: Sat, 29 Oct 2005 16:27:05 -0700
From: robic0@yahoo.com
Subject: Re: Timelocal input, post good Date filters (from - to)
Message-Id: <2tv7m1h3qnevrp49o3jhsi6nkhqn888c9m@4ax.com>
On Thu, 27 Oct 2005 08:15:57 -0400, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
>
>"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
>news:Io38f.7243$ki7.483571@news20.bellglobal.com...
>>
>> <robic0@yahoo.com> wrote in message
>> news:t72ul1htar3krqf6aiflt9mr96ive71kbn@4ax.com...
>>>I get some weird concat warnings on print if enabled so its commented.
>>
>> They aren't weird errors. You don't check if your match succeeds, so you
>> wind up using numbered variables that aren't intialized.
>>
>
>That's a little misleading, on second look (since you manufactured your
>dates to work). You don't require content in all your captures, so you wind
>up with the unintialized warnings. It's still bad practice not to check, and
>feed data that doesn't match your pattern and you will get the messages for
>the above reason.
>
>Matt
>
Well, I gave up a code block. To the extreme, it relaxes content
in the filter to gather the max info in one shot. As you can see,
the filter lets in multiple options as designed. A quick gather and
processing is done after. Given all that this block does I think its
an economical hybrid that can't be done in a single regexp.
Unfortunately, I don't have the time luxury of 1-liners.
I would think this might replace much more code necessary if the
kind of content your thinking of had to be imposed.
But you had know way of knowing.
peace.....
------------------------------
Date: Sat, 29 Oct 2005 18:22:17 -0500
From: "Fred@fred.net" <Fred@fred.net>
Subject: windows program return values vs perl return values from a call to system() -- windows post only
Message-Id: <cm08m158mlsgdelgbpaoa4aks9k3tnp0lr@4ax.com>
I sent this to a friend to demonstrate the way to manage the return
values from a call to system() out of a perl script. Hopefully I did
it ok. (Post regards windows - activestate perl only.)
------------------------------------------------------------------
use strict; #disable iff too restrictive where iff = 'if and only if'
use warnings; #disable iff too noisy where iff = 'if and only if'
my $prog_to_B_run="C:\\WINNT\\system32\\notepad.exe";
system("$prog_to_B_run");
my $stat=$?;
if ($stat) {
print "The exit code of the program was $stat\n";
}
else {
print "Program ran correctly.\n";
print "In Perl any non-zero number (ex. 1) and non-empty string is\n";
print "counted as true. The number zero,zero by itself in a
string,\n";
print "and the empty string are counted as false.\n";
print "The exit code of the program was $stat.\n";
print "The gotcha is windows signals zero for sucess so,\n";
print "the return value here hits the else and means we are OK.\n";
print "\n";
}
#Again in Perl any non-zero number (ex. 1) and non-empty string is
#counted as true. The number zero,zero by itself in a string, and the
#empty string are counted as false.
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8586
***************************************