[15767] in Perl-Users-Digest
Perl-Users Digest, Issue: 3180 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 26 21:05:30 2000
Date: Fri, 26 May 2000 18:05:07 -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: <959389507-v9-i3180@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 26 May 2000 Volume: 9 Number: 3180
Today's topics:
Re: Call me (Abigail)
Re: Can't Knit Two Files Together (Gwyn Judd)
Re: count the number of lines <lr@hpl.hp.com>
Re: Foreach Statement <peter@berghold.net>
HELP::IstallingModules elainebe@my-deja.com
Re: How Sambar 4.2 run CGI ? <red_orc@my-deja.com>
Re: how to /s '[item]' (Gwyn Judd)
Re: IE blocks referer (Coke Harrington)
Re: oops Re: seeking method to encode email addresses i (David H. Adler)
Re: seeking method to encode email addresses in web pag <lr@hpl.hp.com>
Re: seeking method to encode email addresses in web pag (Jerome O'Neil)
Re: seeking method to encode email addresses in web pag <godzilla@stomp.stomp.tokyo>
Re: seeking method to encode email addresses in web pag (brian d foy)
Re: seeking method to encode email addresses in web pag <lr@hpl.hp.com>
Re: seeking method to encode email addresses in web pag (David H. Adler)
Re: Trouble running perlcc baconrad@my-deja.com
Re: Trouble running perlcc baconrad@my-deja.com
Re: updated : Re: regexes *sigh* damn I hate these thin (Abigail)
XS wrapper for (int argc, char *argv[]) style C functio <fcahoon@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 May 2000 22:05:43 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Call me
Message-Id: <8gmsfn$1sj$2@news.panix.com>
On 26 May 2000 20:31:25 GMT, Jim Ward <jfw@saltmine.radix.net> wrote:
++ I wrote a Perl script that uses lynx to monitor a webpage. When
++ a button on the page goes red, it e-mails me. Can anyone suggest
++ a way for it to also call me? I'm on a UNIX machine, with a modem,
++ I'm thinking I record a message ... use cu ...?
Is there any Perl specific part in your question? I don't think so.
Abigail
------------------------------
Date: Sat, 27 May 2000 00:45:34 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Can't Knit Two Files Together
Message-Id: <slrn8j0r5n.3cn.tjla@thislove.dyndns.org>
I was shocked! How could Dan Sugalski <dan@tuatha.sidhe.org>
say such a terrible thing:
>Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:
>> I was shocked! How could Dan Sugalski <dan@tuatha.sidhe.org>
>> say such a terrible thing:
>
>It was the Orbital Mind Control Lasers! They made me say it! :)
Damn those Orbital Mind Control Lasers :)
>>>I think I'm missing something. If you're talking about this sort of thing:
>
>[Snip]
>
>> This has an off-by-one error. It should be:
>
>Whups. Shows how often I write that sort of code. (And, in its own way, an
>argument not to do it that way... :)
yeah I agree, much better to do an implicit loop through using
for(@array)
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
In the force if Yoda's so strong, construct a sentence with words in
the proper order then why can't he?
------------------------------
Date: Fri, 26 May 2000 16:16:12 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: count the number of lines
Message-Id: <MPG.1398a59342ded5498aaf3@nntp.hpl.hp.com>
In article <3925DC90.79A96759@home.com> on Sat, 20 May 2000 00:25:42
GMT, Rick Delaney <rick.delaney@home.com> says...
> Larry Rosler wrote:
> >
> > As for the best search mechanism, I would expect that the index function
> > is faster for finding a literal pattern without metacharacters.
...
> timethese 20000 => {
> Idx => q {
> my $count = grep index($_, 'pattern') == 0 => @a;
> },
> RE => q {
> my $count = grep /^pattern/ => @a;
> },
> };
...
> Idx: 2 wallclock secs ( 1.69 usr + 0.06 sys = 1.75 CPU) @
> 11428.57/s (n=20000)
> RE: 2 wallclock secs ( 1.58 usr + 0.08 sys = 1.66 CPU) @
> 12048.19/s (n=20000)
It took me almost a week to get back to this, but I'm glad I did,
because I differ with your conclusion. If you believe these tests, my
expectation about index() vs regex is correct, by a factor of almost 2.
I simplified the code to reduce to benchmarking only the match, rather
than including the grep.
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
timethese (1 << (shift || 0) => {
Idx => q { my $x = index('pattern', 'pattern') == 0 },
RE => q { my $x = 'pattern' =~ /^pattern/ },
});
__END__
Benchmark: timing 262144 iterations of Idx, RE...
Idx: 1 wallclock secs ( 1.11 usr + 0.00 sys = 1.11 CPU) @
236378.72/ (n=262144)
RE: 1 wallclock secs ( 2.06 usr + 0.00 sys = 2.06 CPU) @
127069.32/ (n=262144)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 27 May 2000 00:37:11 GMT
From: "Peter L. Berghold" <peter@berghold.net>
Subject: Re: Foreach Statement
Message-Id: <392F0BDB.B3DCB7A2@berghold.net>
Without a foreach loop try,
my @ry=qw/ do re me fa so do re me fa so do re me fa so/;
my %een;
my @unique = grep !$een{$_}++,sort @ry;
print join("\n",@unique);
--
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Peter L. Berghold http://www.berghold.net
Peter@Berghold.Net Linux Bigot at Large
"Linux renders ships... Windows NT renders ships useless..."
------------------------------
Date: Sat, 27 May 2000 00:01:52 GMT
From: elainebe@my-deja.com
Subject: HELP::IstallingModules
Message-Id: <8gn399$jg$1@nnrp1.deja.com>
I have downloaded perl 5 binaries (I'm on Solaris) and downloded some
modules into the same directory. after gzip -dc my.module.tar.gz | tar
-xof - I cd to the new dir and type: perl Makefile.PL
I get the message that I have syntax errors. This happens even if I try
to hard code the path to perl5 at the top of the Makefile.PL (as well as
put the path in the @INC and env.
I am a junior programmer and have never installed modules before. Any
help out there??
Elainebe
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 27 May 2000 00:00:30 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: How Sambar 4.2 run CGI ?
Message-Id: <8gn36p$bl$1@nnrp1.deja.com>
In article <8gmejn$mv9$1@news.seed.net.tw>,
"Adolf" <adolftw@tcts1.seed.net.tw> wrote:
> I do not have network card and open ''http://localhost/'' in IE4
> The ''index.htm'' is OK
> but when I link to <a pref=''/cgi-bin/main.cgi''>Click me.</a>
> IE4 showed ''The object requested could not be found on the server.
> ......''
>
>
1. this does not seem to be a perl problem.
2. the main.cgi file is not where the link told the server to find it
3. shouldn't that be <a href="/cgi-bin/main.cgi">Click me. </a>
4. just to be safe, put the full URL to the main.cgi file.
5. remember to set the permissions for execution.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 27 May 2000 00:48:13 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: how to /s '[item]'
Message-Id: <slrn8j0ram.3cn.tjla@thislove.dyndns.org>
I was shocked! How could Larry Rosler <lr@hpl.hp.com>
say such a terrible thing:
>In article <slrn8iunr3.3cn.tjla@thislove.dyndns.org> on Fri, 26 May 2000
>05:36:25 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> says...
>> I think what the OP really wanted was this:
>>
>> s/\[red\]/<font color="red">
>
>Very likely, as the '[' and ']' seem intended as template delineators.
>
>A mildly pedantic note: ']' is a metacharacter only within a character
>class, and indeed even in there not as the first member of the class.
>Not that there's anything wrong with escaping it here, if it makes you
>feel more secure. Just don't do it in a Golf competition. :-)
*grin* I was pretty diffident in correcting you Larry all things
considered. I figure I still have lots and lots to learn. What is a Golf
competition?
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
There is always someone worse off than yourself.
------------------------------
Date: Sat, 27 May 2000 00:16:26 GMT
From: coke@cokesque.com (Coke Harrington)
Subject: Re: IE blocks referer
Message-Id: <slrn8iu513.quu.coke@scallop.lan.cokesque.com>
On Fri, 26 May 2000 13:27:28 -0700, Godzilla! wrote:
> Last three systems however, are not legit
> browsers but rather, hmm... some boys trying
> to hack my sites with little success, other
> than getting themselves into trouble. Still,
> although requests methods rather than actual
> browsers, a referrer variable is clobbered
> but in a different way.
>
> These systems, at my site scripts, have
> their access automatically denied by my
> bots and read a polite message suggesting
> an upgrade to industry standard compatible
> systems / browsers.
Anyone trying to hack your sites would surely send a User-Agent of
"Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)" or similar if you
are blocking other UAs. That is no more reliable than the referer.
> - System: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)
> - System: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
> - System: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
> - System: Mozilla/4.7 [en] (X11; I; Linux 2.2.15-2.5.0 i686)
> - System: Mozilla/4.5 [en] (X11; U; Linux 2.2.14 i586)
> - System: Mozilla/4.51 [en] (X11; U; SunOS 5.7 sun4u)
> - System: Konqueror/1.1.2
> - System: lwp-request/1.39
> - System: libwww-perl/5.47
Konqueror (www.konqueror.org) is the KDE file manager & web
browser--hardly some nefarious hacker's tool. But you probably block
lynx and iCab as well.
--
Coke Harrington
------------------------------
Date: 27 May 2000 00:18:16 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: oops Re: seeking method to encode email addresses in web page forms
Message-Id: <slrn8iu528.ltf.dha@panix2.panix.com>
On Fri, 26 May 2000 10:13:02 -0700, Godzilla!
<godzilla@stomp.stomp.tokyo> wrote:
>The WebDragon wrote:
>
>> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>
>> | $email = "callgirl\@la.znet.com";
>
>> DOH, forgot one thing too.. you can leave off escaping
>> the @ if you use
>
>> $email = 'callgirl@la.znet.com';
>
>However, I am not using apostrophes for quotes.
>This @ character needs to be escaped or a syntax
>error is encountered.
>
>Would you mind citing a rule indicating I must
>use apostophes for quote marks? Seems a matter
>of personal preference, when syntax variations
>are used correctly.
>
>You have tried to force a method upon me.
And where, exactly did he *force* you to do this? He simply pointed
out an alternative way of doing it. If you prefer to do it another
way, I don't see any attempts to stop you.
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Anybody's apt to trip."
"Not over a sofa!" - The Lady Eve
------------------------------
Date: Fri, 26 May 2000 15:24:24 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <MPG.13989977c6d6552098aaf2@nntp.hpl.hp.com>
In article <392EEEA6.73C3602A@stomp.stomp.tokyo> on Fri, 26 May 2000
14:37:42 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
...
> You altered test conditions to yield
> the test results you desired. This is
> not scientific empiricism nor very
> sporting of you.
You must be specific about the code you wrote and the conditions I
altered.
Here is the code you wrote in Message-ID:
<392CF01C.BE324457@stomp.stomp.tokyo>
$email =~ s/(.)/ sprintf('%02x',ord($1)) /ge ;
Here is the code I benchmarked Message-ID:
<MPG.139878859a5bd9d898aaec@nntp.hpl.hp.com>
(my $x = $e) =~ s/(.)/sprintf "%02x", ord $1/ges
The assignment is necessary in order that the same string be operated on
for each cycle of the benchmark. It uses negligible time compared to
the rest.
The punctuation was deparenthesized for easier reading (for me).
The /s modifier was added to maintain exact semantic equivalence with
the corresponding 'unpack' expression that I benchmarked against, and
doesn't change the performance at all.
Factors of more than 38 times in relative performance are hard to blow
away with verbiage about 'altered test conditions'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 26 May 2000 22:30:59 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <DWCX4.1148$YS2.26243@news.uswest.net>
"Godzilla!" <godzilla@stomp.stomp.tokyo> elucidates:
> Larry Rosler wrote:
>> You light up all of our lives!
>
> If this is true, it is a result of my
> being objective and fair yet responding
> with firmness and conviction while
> tending to diplomacy and grace.
Actualy, it's because you are entertaining, like a clown.
You amuse me to no end.
> You altered test conditions to yield
> the test results you desired. This is
> not scientific empiricism nor very
> sporting of you.
Larry is the Lord of the Benchmark, and you can
rest assured, he's right, and you, as always, are
wrong.
------------------------------
Date: Fri, 26 May 2000 16:04:35 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <392F0303.AC87F5E9@stomp.stomp.tokyo>
Larry Rosler wrote:
> In article <392EEEA6.73C3602A@stomp.stomp.tokyo> on Fri, 26 May 2000
> 14:37:42 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
> > You altered test conditions to yield
> > the test results you desired. This is
> > not scientific empiricism nor very
> > sporting of you.
> You must be specific about the code you wrote and
> the conditions I altered.
This represents an objective and scientific test.
Run each script individually exactly and precisely
as you read them, within a pure DOS box environment,
Windows completely shut down.
No modifications may be made except for your
Perl locale first line.
There is only a two character difference in total
between print statements for these scripts. This
I feel can be ignored and still be objective, and
is about as close as I can get to being fair and
still have a pretty printout. This is important.
I have not stated which is faster, only have asked
which is best. As a general rule, sprintf is faster
but I have never tested under these conditions.
I will say, running both scripts as one, takes
far less than the time it takes me to blink my eyes.
Guessing in the hundreds of milliseconds range for
average internet conditions, to load and print.
Personally, I rate programs by how many eye blinks
it takes for a program to load and produce results.
Anything less than an eyeblink, is very fast.
Before you test this, I will warn you about "Stowe"
type thinking. Last this type of issue came about,
a difference of two seconds was noted for iterations
of one-hundred-thousand. I wrote an article showing
this amounts to a savings, for an average/busy site
of two seconds in a year, or one minute in thirty
years. You better do a lot better than this and,
I mean like a relistic difference of say ten minutes
in time savings over a year, which is exceptionally
favorable to you. Ten minutes, this is nothing, spread
out over a year.
A "year" would be one-hundred-thousand hits of these
methods at a rate of two-hundred-seventy-four hits
per day, each day. This would be a fairly busy site
and a fair comparison for _realistic_ consideration.
No alterations save for your Perl locale. All must
be as it is right now, prints and all. This would
represent realistic average conditions for usage.
NO ALTERATIONS
______________
Might want to decant yourself a glass of
fine brandy during this test. Those of us
with a background in science, know there
is a price to be paid for testing under
true and actual conditions; time. I wouldn't
bother keeping count by blinking your eyes,
as I would.
Tell ya what, cut it down to one-thousand
iterations and multiply by one-hundred to
get a relatively fair idea of a 'test year'.
I love my slick trick using sprintf,
very imaginative. However, I am not
the first to do this. I know of another
who did this, maybe a decade back or
even more. I cannot remember who or
where and how, just have a mental note
on "use a sprintf trick" in place of
standard pack methods.
Godzilla!
COMBINED PRINTED RESULTS:
_________________________
TEST ONE:
callgirl@la.znet.com
Sprintf: 63616c6c6769726c406c612e7a6e65742e636f6d
Sprintf: callgirl@la.znet.com
TEST TWO:
callgirl@la.znet.com
Hex Test: 63616c6c6769726c406c612e7a6e65742e636f6d
Hex Test: callgirl@la.znet.com
THIS IS TEST SCRIPT ONE:
________________________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
print "TEST ONE:\n\n";
$email1 = "callgirl\@la.znet.com";
print "$email1 \n\n";
$email1 =~ s/(.)/sprintf('%02x',ord($1))/ge;
print "Sprintf: $email1 \n\n";
$email1 =~ s/([0-9A-Fa-f]{2})/sprintf("%c",hex($1))/ge;
print "Sprintf: $email1 \n\n";
exit;
THIS IS TEST SCRIPT TWO:
________________________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
print "TEST TWO:\n\n";
$email2 = "callgirl\@la.znet.com";
print "$email2 \n\n";
$email2 = unpack ("H*", $email2);
print "Hex Test: $email2 \n\n";
$email2 = pack ("H*", $email2);
print "Hex Test: $email2 \n\n";
exit;
------------------------------
Date: Fri, 26 May 2000 19:14:47 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <brian-ya02408000R2605001914470001@news.panix.com>
In article <392F0303.AC87F5E9@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> posted:
> This represents an objective and scientific test.
yeah, whatever.
> Run each script individually exactly and precisely
> as you read them, within a pure DOS box environment,
> Windows completely shut down.
DOS doesn't have anything to do with it. here's a nickel -
get a better OS.
> I have not stated which is faster, only have asked
> which is best. As a general rule, sprintf is faster
> but I have never tested under these conditions.
then how do you know that? sounds subjective.
> I will say, running both scripts as one, takes
> far less than the time it takes me to blink my eyes.
> Guessing in the hundreds of milliseconds range for
> average internet conditions, to load and print.
how is guessing objective?
> Personally, I rate programs by how many eye blinks
> it takes for a program to load and produce results.
> Anything less than an eyeblink, is very fast.
that is, until you have to run that program 100,000
times an hour, even with caching.
> A "year" would be one-hundred-thousand hits of these
> methods at a rate of two-hundred-seventy-four hits
> per day, each day.
try running a site that gets a million hits a day, and
most of that concentrated in a couple of hours. a lot
of those hits do a lot more than a sprintf, for sure.
> This would be a fairly busy site
> and a fair comparison for _realistic_ consideration.
your cluelessness is eclipsed only by your naivite.
go back to playing with your toy web sites and leave
the big boys alone.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Fri, 26 May 2000 16:34:05 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <MPG.1398a9cb813ab1498aaf4@nntp.hpl.hp.com>
In article <392F0303.AC87F5E9@stomp.stomp.tokyo> on Fri, 26 May 2000
16:04:35 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
...
> I have not stated which is faster, only have asked
> which is best. As a general rule, sprintf is faster
> but I have never tested under these conditions.
> I will say, running both scripts as one, takes
> far less than the time it takes me to blink my eyes.
> Guessing in the hundreds of milliseconds range for
> average internet conditions, to load and print.
>
> Personally, I rate programs by how many eye blinks
> it takes for a program to load and produce results.
> Anything less than an eyeblink, is very fast.
Reading the source of a Perl program, compiling it, and executing the
I/O to print a result -- all these will of course dominate one line of
computation, no matter how poorly it performs (within limits -- I'm sure
things like Abigail's regex prime-number generator would contradict that
generalization).
What I am interested in is real data-processing programs, where the time
is dominated by loops that process many items. That is what
benchmarking is designed to uncover.
...
> I love my slick trick using sprintf,
> very imaginative. However, I am not
> the first to do this. I know of another
> who did this, maybe a decade back or
> even more. I cannot remember who or
> where and how, just have a mental note
> on "use a sprintf trick" in place of
> standard pack methods.
...
> $email1 =~ s/(.)/sprintf('%02x',ord($1))/ge;
...
> $email2 = unpack ("H*", $email2);
I am so happy for you.
Useful generalization for those who approach Perl problems in C-like,
one-character-at-a-time ways:
ANY time you loop to process individual characters, either explicitly or
implicitly (as in Godzilla!'s 'slick trick using sprintf'), look for a
way to do it that puts most or all of the processing into the perl core
(the code within Perl operators or built-in functions), rather than in
the 'glue' between them.
In this case, I demonstrated a 38-to-1 ratio for the above two
statements. More need not be said.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 May 2000 00:12:52 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <slrn8iu4o4.ltf.dha@panix2.panix.com>
On Fri, 26 May 2000 10:27:30 -0700, Godzilla!
<godzilla@stomp.stomp.tokyo> wrote:
>The WebDragon wrote:
>
>> Fiddled with your script a bit, and have a few suggestions:
>
>
>> o don't use so much whitespace unless you *really* need to --
>
>These are my articles. I will format my articles
>in any fashion I choose, Adolf.
[snip more of the same]
I realize I shouldn't bother, but...
Do you not understand the concept of a "suggestion"? You appear to
have a very different concept of it than most, if not all, English
speakers. Hint: It is not the same as "command".
*sigh*
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
'Don't be tempted to veer off!'
- Paul McGann
------------------------------
Date: Fri, 26 May 2000 22:42:40 GMT
From: baconrad@my-deja.com
Subject: Re: Trouble running perlcc
Message-Id: <8gmukt$t8n$1@nnrp1.deja.com>
Thanks, Aaron. I'll get a copy of perl2exe and forget about perlcc.
In article <392D56B1.C3A5019A@csuchico.edu>,
Aaron <alager@csuchico.edu> wrote:
>
>
> baconrad@my-deja.com wrote:
>
> > I am having a hell of a time getting perlcc to work at all. I am
using
> > the simplest possible "hello world" code. Any help is greatly
> > appreciated.
> >
> > Following is what I think is all pertinent information.
> >
> > OS:Windows 98
> > Perl: ActiveState perl build 613 for perl v5.6.0 (upgraded for
running
> > perlcc)
> > C compiler: MS Visual C++ 6.0 (installed to do perlcc)
> > Environment: Added C++ bin directory to path, ran vcvars32.bat
> > Location: In my own c:\PerlTest directory (though I have tried
others)
> > Code: 1 line, print("Hello World");
> > Command: perlcc hello.pl
> >
> > Following is the output I get:
> >
> > <<snip>>
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> If you are trying to get a binary of your script, you may want to try
> perl2exe. I've used it on NT and it works great. depending on how
complex
> your script is it may or may not work on win9x. I used a lot of
perl/tk
> which is buggy on 9x anyways, so we stayed on NT.
> check out http://www.perl2exe.com
>
> Aaron
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 26 May 2000 22:54:16 GMT
From: baconrad@my-deja.com
Subject: Re: Trouble running perlcc
Message-Id: <8gmvai$tn4$1@nnrp1.deja.com>
I sure wish the doc at www.perl.com included those comments. The bat
files themselves might print a disclaimer with each error message as
well. It would have saved me (and probably a number of other people) a
few hours. I messed around with C compilers, upgraded my version of
perl, experimented with my perl scripts, tried going through the perlcc
scripts, etc. I didn't want to post and ask for help until I'd
exhausted all options.
Perlcc is presented as a viable working option, not as an experiment.
So it goes...
In article <Pine.GSO.4.10.10005241043130.14618-
100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Wed, 24 May 2000 baconrad@my-deja.com wrote:
>
> > The manpage ony says I can't compile shared objects in Win32 (which
I'm
> > not) and that I need at least perl 5.005 (I have build 613 for perl
> > v5.6.0 ). Is there something else I am missing?
>
> It should include these paragraphs as well:
>
> The whole compiler suite (C<perlcc> included) should be considered
> very experimental. Use for production purposes is strongly
> discouraged.
>
> Bugs in the various compiler backends still exist, and are
perhaps too
> numerous to list here.
>
> > I would really like to use this as an alternative to installing perl
> > on many client machines.
>
> That is strongly discouraged. :-)
>
> It's still easier in general to install perl on each client machine,
then
> to install all the scripts you'd like.
>
> Cheers!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 May 2000 22:42:01 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: updated : Re: regexes *sigh* damn I hate these things
Message-Id: <8gmujp$2m3$1@news.panix.com>
On Fri, 26 May 2000 07:35:24 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
++ The WebDragon wrote:
++
++ >is there an easier way to get a count of the $name(s) than this? I can
++ >do a scalar(keys %listing) to get a count of the gametypes found, but
++ >how do I get a count of the $listing{*}{$name} keys ? is there a
++ >shortcut or no?
++
++ I think you want the sum of the number of keys for each gametype.
++
++ Functional programming solution:
++
++ @totalgames = sum( map { scalar keys %{listing{$_}} }
++ keys %listing);
++
++ sub sum {
++ my $total = shift;
++ $total += $_ foreach @_;
++ return $total;
++ }
I guess you want $totalgames there, but I wouldn't call it "functional".
For it to be functional, it shouldn't make use of side effects, like
assignment.
A neat trick would be:
sub sum {@_ ? shift () + &sum : 0}
but that's cheating as shift() uses a side effect.
Hence:
sub head {$_ [0]}
sub tail {@_ [1 .. $#_]}
sub sum {@_ ? &head + &sum (&tail) : 0}
print sum map {scalar keys %$_} values %listing;
The last line uses values %listing, instead of keys() and extra hash lookups.
Of course, there's still an implicit side effect, as a subroutine call
will set @_.
Abigail
------------------------------
Date: Fri, 26 May 2000 22:42:51 GMT
From: Forrest Cahoon <fcahoon@my-deja.com>
Subject: XS wrapper for (int argc, char *argv[]) style C function?
Message-Id: <8gmul8$t8o$1@nnrp1.deja.com>
Hello, everyone!
I'm trying to write an XS wrapper for Ghostscript.
(Has anyone done that already? It could save me some work ...)
I'm on a VMS system, and for some reason, h2xs doesn't seem to work
properly -- it will set up all my files, but just ignores the
prototypes in my .h file. That's a weirdness I'd like to solve one
day, but I've been able to write some simple XS hooks into my company's
internal C functions in any case, and I was hoping to just write the XS
code to hook into Ghostscript myself.
What I'm hoping to get is routine I can call like so:
Ghost::invoke(qw(-sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps));
in other words, just pass the parameters I would pass to Ghostscript on
the command line. I'm using the "system" call in my current perl code,
of course. The reason why I would like to write an XS wrapper is
because I thought that I would get a performance advantage if I don't
have to spawn a subprocess. (Is that accurate? I have heard that on
VMS, spawning a subprocess has a high overhead.)
The arguments to main() are argc and argv. I want to pass in a list
from perl, and convert this into argc and argv at the top of my XS code.
I bet that would actually come in handy a lot.
Can anyone give me some pointers?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3180
**************************************