[10705] in Perl-Users-Digest
Perl-Users Digest, Issue: 4304 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 26 20:07:42 1998
Date: Thu, 26 Nov 98 17:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 26 Nov 1998 Volume: 8 Number: 4304
Today's topics:
ADODB Problems, sample code inside <lss@shaw.wave.ca>
Re: Another crypt question <rootbeer@teleport.com>
Re: Another crypt question (Tad McClellan)
Re: Bind won't take variables <rick.delaney@shaw.wave.ca>
Re: embedded perl's memory management (Ilya Zakharevich)
HELP!!! REAL simple script doesn't work! lkleiner@perfectsolve.com
Re: HELP!!! REAL simple script doesn't work! <rick.delaney@shaw.wave.ca>
Re: HELP!!! REAL simple script doesn't work! (Alastair)
Re: HELP!!! REAL simple script doesn't work! (Larry Rosler)
Re: Help..I'm Way Over My Head (Bradley K. Farrell)
How to: determine if the recipient e-mail adress is val <proband@cam.org>
Re: How to: determine if the recipient e-mail adress is (Rich)
Re: How to: determine if the recipient e-mail adress is (Martien Verbruggen)
Just starting <jon.hubbard@ndirect.co.uk>
Re: Just starting <rick.delaney@shaw.wave.ca>
Re: Obfuscation of perl scripts <rra@stanford.edu>
Re: Perl compiler? <pkg@studbox.uni-stuttgart.de>
Re: Perl in HTML - without FORM <pkg@studbox.uni-stuttgart.de>
Re: Perl in HTML - without FORM (Martien Verbruggen)
Re: Perl in HTML - without FORM (Bart Lateur)
Re: Perl performance on VMS <sugalskd@netserve.ous.edu>
perlwin32(5.005_02) causes a page violation error under <kipp@shonan.ne.jp>
problem <stmintz@yahoo.com>
Re: problem <rick.delaney@shaw.wave.ca>
Re: problem (Tad McClellan)
rounding of int <lux@coo.mts.dec.com>
Re: rounding of int (Martien Verbruggen)
Re: Serial programming question (L J Bayuk)
Re: sql & perl how? (Alastair)
Re: Substitution: \x & backreference <alexsh@linux.org.il>
Re: Thanksgiving (Larry Rosler)
Re: Thanksgiving <r28629@email.sps.mot.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 26 Nov 1998 21:33:59 GMT
From: "LSS" <lss@shaw.wave.ca>
Subject: ADODB Problems, sample code inside
Message-Id: <bPj72.943$Pc1.1444989@news.rdc1.on.wave.home.com>
The code below once worked. As of the merged Win32 perl builds it fails.
sub dbOpen
{
my($Cn, $Cm, $Rs, $Errors, $LoadName, $retval);
$LoadName = $_[3];
$retval = 0;
$Cn = CreateObject OLE "ADODB.Connection";
if ( $Cn )
{
$Cn->{ConnectionTimeout} = 15;
$Cn->{CommandTimeout} = 30;
$Cm = CreateObject OLE "ADODB.Command";
if ( $Cm )
{
$Rs = CreateObject OLE "ADODB.Recordset";
if ( $Rs )
{
$Cn->Open($LoadName, "", "");
#print ">> " . $LoadName;
#print "\n";
#$Cn->{ConnectionString} = $LoadName;
#$Cn->Open();
#$Cm->{ActiveConnection} = $Cn;
$Errors = $Cn->Errors();
$retval = keys %$Errors;
if ( $retval )
{
$retval = 0;
print "Load Name: $LoadName\n";
foreach $item ( keys %$Errors )
{
print "$item->{Description}\n"
}
SetErrMsg("Unable to open ADO connection.");
}
else
{
$Cm->{ActiveConnection} = $Cn;
$Cm->{CommandType} = 1;
$Rs->{CursorType} = 1;
$Rs->{LockType} = 3;
$_[0] = $Cn;
$_[1] = $Cm;
$_[2] = $Rs;
$retval = 1;
}
}
else
{
SetErrMsg("Unable to create ADO recordset object.");
}
}
else
{
SetErrMsg("Unable to create ADO command object.");
}
}
else
{
SetErrMsg("Unable to create ADO connection object.");
}
return $retval;
}
The jet engine reports:
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
The failure is during the Open(). Note the commented form of open is
equivalent. The Activesate ADO samples on their web site are also broken
(now). Their error checking should be as show above.
Any ideas?
------------------------------
Date: Thu, 26 Nov 1998 19:00:22 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Another crypt question
Message-Id: <Pine.GSO.4.02A.9811261056020.23068-100000@user2.teleport.com>
On Thu, 26 Nov 1998, Mary E Tyler wrote:
> I am looking for a strong encryption module for a ballotting system.
> Is the built in crypt appropriate?
>
> The camel book seems to suggest not...
Do you expect us to contradict the Camel and the online docs? My copy of
perlfunc says:
Note that crypt is intended to be a one-way function, much like
breaking eggs to make an omelette. There is no (known) corresponding
decrypt function. As a result, this function isn't all that useful
for cryptography. (For that, see your nearby CPAN mirror.)
> okay, i've been to CPAN and found the PGP module... but I have no idea
> if the target system will have PGP available to the script... and my
> test system does not have PGP available from the command line (i *love*
> macs sometimes... no command line at all! ak.)
>
> even so, i am not sure how to use the module. would someone be kind
> enough to provide an example? or is there one that is more simple?
Last time I saw, that module was somewhat unfinished; you may need to
finish it, or make your own, or use a different encryption method. Many of
us in the US would like to work on encryption software but can't share our
work, the federal laws being as they are. (But let's not discuss that
here, since it has nothing to do with Perl.)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 26 Nov 1998 17:54:34 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Another crypt question
Message-Id: <qnpk37.129.ln@flash.net>
Mary E Tyler (dejahvu@erols.com) wrote:
: I am looking for a strong encryption module for a ballotting system. Is
: the built in crypt appropriate?
crypt() will work fine...
... unless you also want to recover the encrypted data.
;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 26 Nov 1998 23:58:29 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Bind won't take variables
Message-Id: <365DECD7.163EA4D3@shaw.wave.ca>
Larry Rosler wrote:
>
> Well, yes, I mentioned (?i), and Rick Delaney suggested the
^^^^^^^^^
> undocumented (?g), and Tom Phoenix said that (?g) was "unsupported"
> and "volatile".
I certainly hope that nobody would actually use (?g) in their code after
reading my post (thanks to Tom Phoenix for effectively stopping that).
I did not mean to _suggest_ its use or the use of any undocumented
behaviour. I was just trying to find out if it was either left out of
the documentation or if it should ever be supported at all.
I like the idea that all of the switches be supported this way, but (?o)
would be kind of silly so maybe there are reasons to never support (?g)
also? I doubt I would even ever use it but it seems like the original
poster would if it was a feature of the language.
>
> The only (?...) documented in perlre are 'imsx'. Who ya' gonna trust?
If you can't trust the docs, who can you trust? Glad to see they don't
need patching (on this issue). Although I guess I still have to patch
/(?)/.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 26 Nov 1998 19:46:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: embedded perl's memory management
Message-Id: <73kb68$apj$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Janos Kocsis
<kocsi@gmx.de>],
who wrote in article <365D3D93.56D0@gmx.de>:
> int match(char *string, char *pattern)
> {
> static acBuff [1024];
>
> sprintf (acBuff, "$_ = '%s'; if ( /%s/ ) {1;} else {0;}", string,
> pattern);
> return (SvIV(perl_eval_pv(acBuff, TRUE)));
> }
> while (1)
> {
> match ("M250125267246+00001.", "M25[0-9]*[+]0000[0-9]");
> }
You do not allows Perl to free temporaries. grep for ENTER/LEAVE/FREETMPS
in the fine manual.
Ilya
------------------------------
Date: Thu, 26 Nov 1998 23:49:21 GMT
From: lkleiner@perfectsolve.com
Subject: HELP!!! REAL simple script doesn't work!
Message-Id: <73kpdu$r2s$1@nnrp1.dejanews.com>
I have apache 1.3.3, RedHat Linux (2.0.36) and am executing this simple
script. For some reason the script is not reading (or not getting) the
environment variable. Here's the script:
#!/usr/bin/perl
print "Conent-type: text/html\n\n";
print "query string=$ENV{'$QUERY_STRING'}";
The output I receive in the browser is:
query string=
Can anyone explain this. Any help would be GREATLY appreciated.
Thanks,
Lee Kleiner
lkleiner@perfectsolve.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 27 Nov 1998 00:10:55 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: HELP!!! REAL simple script doesn't work!
Message-Id: <365DEFB7.11B7EC31@shaw.wave.ca>
[posted & mailed]
lkleiner@perfectsolve.com wrote:
>
> #!/usr/bin/perl
> print "Conent-type: text/html\n\n";
> print "query string=$ENV{'$QUERY_STRING'}";
^
^
$ENV{'QUERY_STRING'}
You would probably be better off using CGI.pm.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Fri, 27 Nov 1998 00:45:06 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: HELP!!! REAL simple script doesn't work!
Message-Id: <slrn75rtfj.7v.alastair@calliope.demon.co.uk>
lkleiner@perfectsolve.com <lkleiner@perfectsolve.com> wrote:
>I have apache 1.3.3, RedHat Linux (2.0.36) and am executing this simple
>script. For some reason the script is not reading (or not getting) the
>environment variable. Here's the script:
>
>#!/usr/bin/perl
>print "Conent-type: text/html\n\n";
>print "query string=$ENV{'$QUERY_STRING'}";
In addition to Rick's reply, you might also want to spell 'Content' correctly.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 26 Nov 1998 16:40:41 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP!!! REAL simple script doesn't work!
Message-Id: <MPG.10c794e557e521f4989927@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <73kpdu$r2s$1@nnrp1.dejanews.com> on Thu, 26 Nov 1998
23:49:21 GMT, lkleiner@perfectsolve.com <lkleiner@perfectsolve.com>
says...
> #!/usr/bin/perl
Where are '-w' and 'use strict;'? Not that it matters with this trivial
a program.
> print "Conent-type: text/html\n\n";
print "Content-type: text/html\n\n";
I assume that is a typo, or you would get nothing but a server error.
Suggested to cut-and-paste actual code in future submissions.
> print "query string=$ENV{'$QUERY_STRING'}";
The problem is here. There is no $ in the hash-index of an environment
variable. You may be thinking of a shell variable, which this isn't.
print "query string=$ENV{'QUERY_STRING'}";
or
print "query string=$ENV{QUERY_STRING}";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 26 Nov 1998 18:35:51 GMT
From: bradley@iinet.net.au (Bradley K. Farrell)
Subject: Re: Help..I'm Way Over My Head
Message-Id: <36619ec3.92595464@news.m.iinet.net.au>
Hunter Padgett <flajobs@gate.net> wrote:
>I am lost.
Yikes! Then how did you find this place!
>I know this is kinda broad, but if anyone has gone through this, I'd
>appreciate your insight.
I know how you feel. A few months ago, I wanted to do some stuff in
Perl, but realised I knew nothing about the language. So I bought a
book, and taught myself. I reckon that's what you should do <g>
HTH
--
Bradley K. Farrell
bradley@iinet.net.au
------------------------------
Date: Thu, 26 Nov 1998 14:42:13 -0500
From: Sylvain Lavigne <proband@cam.org>
Subject: How to: determine if the recipient e-mail adress is valid
Message-Id: <365DAF15.8701BDF0@cam.org>
HI!
I have a list of members I collected and I every month I have to
send information to them.
Is there a way in perl to determine if the recipient e-mail address is
still valid before
sending any information to an inexistant recipient address?
All suggestion will be welcome.
CIAO!
------------------------------
Date: 26 Nov 1998 20:37:02 GMT
From: richm@ucesucks.mulveyr.roc.servtech.com (Rich)
Subject: Re: How to: determine if the recipient e-mail adress is valid
Message-Id: <slrn75resi.teh.richm@ll.aa2ys.ampr.org>
On Thu, 26 Nov 1998 14:42:13 -0500, Sylvain Lavigne <proband@cam.org> wrote:
>HI!
>
>I have a list of members I collected and I every month I have to
>send information to them.
>
>Is there a way in perl to determine if the recipient e-mail address is
>still valid before
>sending any information to an inexistant recipient address?
>
>All suggestion will be welcome.
>
Because of the various gateways, aliasing, address rewriting,
and other assorted hoops that mail systems provide, the only
reliable way of determining whether an e-mail address is valid
is to send something to it, and wait for a "Not deliverable"
message a few days later. Of course, you can always use Perl
to parse the messages and remove those people from your
mailing list. :-)
- Rich
--
Rich Mulvey
My return address is my last name,
followed by my first initial, @mulveyr.roc.servtech.com
http://mulveyr.roc.servtech.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa
------------------------------
Date: Thu, 26 Nov 1998 21:31:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to: determine if the recipient e-mail adress is valid
Message-Id: <OMj72.7$tN2.148@nsw.nnrp.telstra.net>
In article <365DAF15.8701BDF0@cam.org>,
Sylvain Lavigne <proband@cam.org> writes:
> Is there a way in perl to determine if the recipient e-mail address is
> still valid before
> sending any information to an inexistant recipient address?
# perldoc perlfaq9
[snip]
How do I check a valid mail address?
You can't, at least, not in real time. Bummer, eh?
[snip]
There's more. I'll leave it up to you to read the rest.
HTH,
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Think of the average person. Half of
Commercial Dynamics Pty. Ltd. | the people out there are dumber.
NSW, Australia |
------------------------------
Date: Thu, 26 Nov 1998 23:54:12 +0000
From: "Jon Hubbard" <jon.hubbard@ndirect.co.uk>
Subject: Just starting
Message-Id: <365de954.0@hades.ndirect.co.uk>
I'm just starting to get into CGI scripts etc but have a problem. I have
been advised that I should try everything locally before uploading it and
have set up a Win95 machine running Sambar as my Web Server software. This
all works fine except that I cannot run CGI.
Any one got any tips for this newbie who probably should have never started
all this!
Many thanks iun advance
------------------------------
Date: Fri, 27 Nov 1998 00:07:19 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Just starting
Message-Id: <365DEEEA.EBF6DA2D@shaw.wave.ca>
[posted & mailed]
Jon Hubbard wrote:
>
> I'm just starting to get into CGI scripts etc but have a problem. I
> have been advised that I should try everything locally before
> uploading it and have set up a Win95 machine running Sambar as my Web
> Server software. This all works fine except that I cannot run CGI.
>
> Any one got any tips for this newbie who probably should have never
> started all this!
The best tip I can give you is that Perl is not a web server. You might
want to try comp.infosystems.www.servers.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 26 Nov 1998 13:01:35 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Obfuscation of perl scripts
Message-Id: <ylvhk22mog.fsf@windlord.stanford.edu>
Vlad Volkov <vvolkov@benton.com> writes:
> I rather meant changing variable names from, say, @user_names to
> @c354fbg within a module. "\n"s can be easily put back with
> corresponding Perl script. If you sell consulting in Perl for some
> particular field, in my case data loaders, you would not want somebody
> on the client side to learn the technics and take the business from you,
> eh?
If a consultant gave me obfuscated code for a project that I was paying
them for, I'd fire them on the spot.
I realize that you probably mean well and think this is necessary, but it
really is not. The skill that people are paying you for as a consultant
is your ability to solve *new* problems, not use a standard bag of
tricks. Anyone can do that, and a lot of them are published in books or
available on-line. Programmers don't get paid for being smart;
programmers get paid for *applying* their knowledge to a problem, and no
one can steal that from you.
The reason why I'd fire someone who did that isn't just because I have an
expectation of being able to use code *that I've purchased* (if you do
contract work for someone else, you're delivering to them a product, and
delivering a product they then can't use without hiring you again is the
sort of trick Microsoft would pull). It's because anyone who would stoop
to such a tactic obviously is not secure in their own programming ability,
and that means they're not good enough at what they do to be worth my
money.
Obfuscators are fun toys. Stuff like my sig is great for amusement. It
doesn't have any place in production code.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 26 Nov 1998 22:29:10 +0100
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: Perl compiler?
Message-Id: <365DC826.D6F06D96@studbox.uni-stuttgart.de>
Mattjm82 wrote:
>
> Douse Perl need a complier like c++ and other programming languages? If so
> about how much douse it go for? Thanks alot.
to run perl you need a perl interpreter (which may need a one time
compilation itself).
look around at http:/www.cpan.org
------------------------------
Date: Thu, 26 Nov 1998 22:34:06 +0100
From: Pete Gilbert <pkg@studbox.uni-stuttgart.de>
Subject: Re: Perl in HTML - without FORM
Message-Id: <365DC94E.17DF1450@studbox.uni-stuttgart.de>
as far as I know you just point your hyperlink at your script. but if
you want to pass parameters to the script, you'll probably need a form,
unless you're more clever than I am.
"Jxrgen Vig Jensen" wrote:
>
> I want to execute a perl-program just by pressing a hyperlink.
> Without any inputfields.
>
> I have placed the html- and .pl on a linux web-server - and want to use it
> by ie4 in windows95.
------------------------------
Date: Thu, 26 Nov 1998 21:35:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl in HTML - without FORM
Message-Id: <oQj72.8$tN2.148@nsw.nnrp.telstra.net>
In article <365DC94E.17DF1450@studbox.uni-stuttgart.de>,
Pete Gilbert <pkg@studbox.uni-stuttgart.de> writes:
> as far as I know you just point your hyperlink at your script. but if
> you want to pass parameters to the script, you'll probably need a form,
> unless you're more clever than I am.
No need for cleverness. Just a need for knowing the available options
of the protocol and stuff.
You know, they talk about this kind of stuff in the
comp.infosystems.www.* hierarchy, which is why I have set followups to
the most appropriate group there.
> "Jxrgen Vig Jensen" wrote:
>>
>> I want to execute a perl-program just by pressing a hyperlink.
>> Without any inputfields.
>>
>> I have placed the html- and .pl on a linux web-server - and want to use it
>> by ie4 in windows95.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd. | population.
NSW, Australia |
------------------------------
Date: Thu, 26 Nov 1998 23:21:07 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl in HTML - without FORM
Message-Id: <365de1de.772849@news.skynet.be>
Pete Gilbert wrote:
>as far as I know you just point your hyperlink at your script. but if
>you want to pass parameters to the script, you'll probably need a form,
>unless you're more clever than I am.
Change the method from "post" to "get". That's right: add a question
mark following the URL of your script, and you can add any parmaeters
you like. As long as the total length doesn't get too long.
HTH,
Bart.
------------------------------
Date: 27 Nov 1998 00:43:53 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
To: youngej@magpage.com
Subject: Re: Perl performance on VMS
Message-Id: <73ksk9$kvb$1@news.NERO.NET>
Ed Young <youngej@magpage.com> wrote:
: ------- Forwarded by Ed Young for Jan van der Weele
: Request for Assistance - Perl VMS performance and tuning.
: We use an unattended file transfer facility written in Perl on UNIX, NT,
: and VMS. The implementations on UNIX and NT run at acceptable speeds.
: Virtually the same code on VMS takes significantly longer (orders of
: magnitude).
: A simple benchmark program to measure some key Perl performance numbers
: shows that operations which are crucial in our application are
: significantly less efficient on VMS than on the other platforms:
[Table snipped]
: From the table, it is clear that under VMS every action takes a lot more
: resources that on the other platforms. The VMS Perl implementation was
: compiled with DEC/C. Has anybody else experienced the same relative
: performance penalty when using Perl on VMS? Are there any suggestions
: how
: we can improve its performance (e.g. other compiler, VMS quota
: settings)?
Well, you've left off a number of fairly important bits, of information,
so it's tough to tell exactly what's wrong. In general, the VMS port of
perl is as fast as perl on any other platform. There's nothing
VMS-specific which will slow down perl. A perl script will run at
approximately the same speed under VMS, TCFKAD Unix, and Linux, given the
same hardware.
However, VMS (and thus perl on VMS) runs on harware with an amazingly wide
range of performance characteristics, from high-end Alphas with cutting
edge EV6 chips, to MicroVaxes that run just slightly slower than dead
badgers. (The only way to speed up a MicroVax I is to throw it harder. But
I digress) AFAIK, perl will run on every piece of hardware that'll run
VMS. (Yep, including those old Vax 11/780s, which will run VMS 5.5-2)
But that's not a whole lot of help. There are a few things that'll
specifically screw your performance under VMS that can be looked at.
1) Too small a working set
Since VMS allows per-account restrictions on the amount of memory a
process can snag, you may find yourself pagefaulting if an account's WSQUO
is too small. Firing up the process and then doing a SHOW PROC/CONT/ID=pid
will let you monitor the process. Pay careful attention to the page faults
number--if it keeps increasing as the process runs, you're running out of
memory. Going into AUTHORIZE and upping the WSQUO and WSMAX quotas will
allow processes running under the account to grab more memory if it's
available.
2) Too little memory on the system
It's possible that the system is just starved for memory. Running perl on
a Vax with 14 (or 8, or 4) meg will get you lousy performance no matter
what you do. (Or no matter what OS is running--it's certainly not a
problem limited to VMS.
Do a SHOW MEMORY on the system and check out the Free column. Also do a
MONITOR PAGE to watch the system's paging activity. That'll help you
determine if the system's just starved for memory
3) Too slow a machine
You might just be comparing a slow Vax to a fast Sun/HP box. (This
wouldn't account for the big difference in speed between assignment and
other ops, but it will affect performance)
4) Other stuff's going on
It's also possible the VMS box is being used for other things--if another
process is snagging 85% of the CPU, you might be out of luck.
5) You might have an old version of the Dec C RTL installed.
There were some serious performance issues related to single-character IO
in old versions of the C RTL on VMS. (VMS, having record-oriented rather
than bytestream files, isn't that thrilled with byte-level IO) Check the
VMS ECO ftp site for new versions. (Start at
ftp://ftp.service.digital.com/pub/vms and go from there--choose axp or
vax, and then VMS version) The patchkits are ALPACRTxx for alphas and
VAXACRTxx for Vaxen--read the release notes and choose as appropriate.
Anyway, I'd guess either 1 or 2 is your problem, but it's tough to tell
for sure without more details. You can drop me a line if you want to work
out more details. If the hardware you're running on isn't just grossly
underpowered, I'd bet we can shrink that run time quite a bit.
Dan
------------------------------
Date: Fri, 27 Nov 1998 07:26:19 +0900
From: "SUZUKI Norio" <kipp@shonan.ne.jp>
Subject: perlwin32(5.005_02) causes a page violation error under Windows95
Message-Id: <73kkr3$1ke@news.fortune.ad.jp>
After compiling perlwin32(5.005_02) with BCC32(Borland C compiler) under
Windows NT,
I moved them into Windows95 platform(4.00.950a). Then I ran test scripts
under t subdir.
When the perl encountered the line containing "%ENV=();" in t/op/magic.t, it
caused
a page violation error.
Is there anyone can fix this trouble?
SUZUKI Norio <kipp@shonan.ne.jp>
------------------------------
Date: Thu, 26 Nov 1998 14:29:22 -0600
From: "Sean Mintz" <stmintz@yahoo.com>
Subject: problem
Message-Id: <73kddk$9pc$1@Masala.CC.UH.EDU>
hello!
in my program i tried to do this;
foreach $dog ($log{$num}) {
print "$dog\n";
}
if there is more than 1 thing in $log{$num} it only says the last one
thanks
Sean Mintz <stmintz@yahoo.com>
------------------------------
Date: Thu, 26 Nov 1998 22:58:24 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: problem
Message-Id: <365DDEBF.58302E46@shaw.wave.ca>
[posted & mailed]
Sean Mintz wrote:
>
> hello!
> in my program i tried to do this;
>
> foreach $dog ($log{$num}) {
> print "$dog\n";
> }
>
> if there is more than 1 thing in $log{$num} it only says the last one
There cannot be more than one thing in $log{$num} since it is a scalar.
Perhaps the one thing is a reference to an array? If so you must
dereference it:
foreach $dog ( @{ $log{$num} } ) {
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Thu, 26 Nov 1998 18:00:21 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: problem
Message-Id: <l2qk37.129.ln@flash.net>
Sean Mintz (stmintz@yahoo.com) wrote:
: Subject: Re: problem
One problem is that you didn't put the subject of your
article in the Subject header.
Please try to do that in the future.
: in my program i tried to do this;
: foreach $dog ($log{$num}) {
: print "$dog\n";
: }
: if there is more than 1 thing in $log{$num} it only says the last one
^^^^^
What'sa thing?
Care to show us an example of the "things" you are talking about?
You need a list where $log{$num} is there.
If $log{$num} is a string with fields, then you need
to separate the fields into a list:
foreach $dog ( split /:/, $log{$num}) {
If $log{$num} is a reference to an array, then you need
to dereference it:
foreach $dog ( @$log{$num}) {
If $log{$num} is something else, then you need to do something
else...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 26 Nov 1998 09:27:50 +0100
From: Wolfgang Lux <lux@coo.mts.dec.com>
Subject: rounding of int
Message-Id: <365D1105.9420BD02@coo.mts.dec.com>
When executing:
print 2.78 * 10000,"\n";
print int(2.78 * 10000),"\n";
the result is:
27800
27799
How can I use int with the rounding of the first statement?
Wolfgang Lux
------------------------------
Date: Thu, 26 Nov 1998 21:29:30 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: rounding of int
Message-Id: <_Kj72.6$tN2.148@nsw.nnrp.telstra.net>
In article <365D1105.9420BD02@coo.mts.dec.com>,
Wolfgang Lux <lux@coo.mts.dec.com> writes:
> When executing:
> print 2.78 * 10000,"\n";
> print int(2.78 * 10000),"\n";
> the result is:
> 27800
> 27799
Didn't you post this a few days ago as well? You got two answers back
then. Check dejanews if your newsserver doesn't have that thread
anymore.
Not only do you not read the FAQ, you also don't read followups to
your own post. I wonder if you'll ever see this.
FYI: The other thread was titled 'rounding with int'
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | The number of the beast is not 666. Its
Commercial Dynamics Pty. Ltd. | number is 95, and it's awake.
NSW, Australia |
------------------------------
Date: 26 Nov 1998 22:21:59 GMT
From: lbayuk@mindspring.com (L J Bayuk)
Subject: Re: Serial programming question
Message-Id: <slrn75rl24.l4.lbayuk@lbayuk.none>
dan_stefura@mad.scientist.com wrote:
>Hello world,
>
>I'm about to start a project of getting my Kodak DC-220 digital camera to talk
>to my serial port using Linux. I am most likely going to do it in Perl, and
>eventually use the GTK.
>
>After hunting down info on serial port programming, I have found various
>resources that should get me started.
>
>The first stumbling block before I even start to write some code is this:
>
>I need to send a pulse on the Reset/Att line sent from the host computer to
>the camera. This pulse must be at least 50 microseconds. Once I do this I
>will receive a packet and away I go sending and receiving more specially
>constructed packets.
>
>It sounds easy enough, but I see no mention of how to send a pulse on the
>Reset/Att line, or anything about a Reset/Att line in the RS232 specs.
>
>I'm guessing it's something relatively easy, and I'm overlooking something.
>
You aren't missing anything because there is no such thing in RS232. Does
the camera use a special cable which connects one of the standard RS232
lines (like maybe a modem control line) to something the camera calls
"Reset/Att" ?
------------------------------
Date: Thu, 26 Nov 1998 23:14:08 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: sql & perl how?
Message-Id: <slrn75ro51.5u.alastair@calliope.demon.co.uk>
Stefan Voelkel <voelkel@hrz1.hrz.tu-darmstadt.de> wrote:
>hello!
>
>im looking for an tutorial or perl script or help file on how to use
>perl with a mysql-database. i found this link on the mysql-manual but
>theres only this script-package:
Assuming you have MySQL set up, you should look at the DBI module. This includes
documentation on use (perldoc DBI). Check CPAN for ;
Get the DBI module and the Msql-Mysql-modules at ;
http://www.arcana.co.uk/technologia/perl/DBI/index.html
Examples at ;
http://eskimo.tamu.edu/~jbaker/dbi-examples.html
Read the docs and try it out.
You need MySQL working though!
>"Perl package to generate html from a SQL table structure and for
>generating SQL statements from an html form. "
>url: http://www.odbsoft.com/cook/sources.htm
Don't know anything about this. DBI is perhaps the best foundation.
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 27 Nov 1998 02:46:20 +0200
From: Alex Shnitman <alexsh@linux.org.il>
Subject: Re: Substitution: \x & backreference
Message-Id: <qiiogpu9d43.fsf@beitza.jct.ac.il>
Pieter Liefooghe <pieter@info.vub.ac.be> writes:
> given $FName = "http%3A%%2F%%2F%www.mysite.be"; I want to get
> "http://www.mysite.be"
Here you go:
s/%([0-9a-fA-F]{2})%/chr(hex($1))/ige;
It might not be the most efficient way but it works.
HTH,
--Alex
------------------------------
Date: Thu, 26 Nov 1998 11:02:27 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Thanksgiving
Message-Id: <MPG.10c745995eda52e4989926@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <73jitc$gt6$0@206.165.167.210> on 26 Nov 1998 12:51:56 GMT,
Allan M. Due <due@murray.fordham.edu> says...
> Sometimes I think that thank-you is not said enough in this group so I
> just wanted to take a moment and say that I, for one, am very thankful for
> all the great assistance that I have received from this group.
Thank *you*, Allan, for taking the initiative to express what many of us
feel.
When I compare what little I knew about Perl when I made my first post
almost a year ago to what little more I know now, I realize how much I
have profited. Also, I have made friends and penpals in faraway
places, some of whom I have met since and some I may never meet. This
is a very constructive and supportive group.
> Well, I have rambled on more than I intended. Have a great holiday.
And a happy day to all except the turkeys (human or otherwise).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 26 Nov 1998 15:56:55 -0500
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Thanksgiving
Message-Id: <365DC076.D0DEC965@email.sps.mot.com>
Allan M. Due wrote:
>
> Hi Folks,
>
> Sometimes I think that thank-you is not said enough in this group so I
> just wanted to take a moment and say that I, for one, am very thankful for
> all the great assistance that I have received from this group. When I stop
> to think about it, I am amazed that so many bright people take time out of
> their busy lives to educate and assist others for free. I have learned so
> much (even though there is so much more to learn) that it seems quite
> incredible that most of my instruction has come from posts in this
> newsgroup.
> The sharing of knowledge is one of the truly great gifts. So, thanks to
> everyone for all their great answers and great questions. Thanks also for
> the not so great answers that were quickly corrected, thereby teaching me
> common traps and how to avoid them. Thanks for all the inappropriate
> questions that somehow, in the end, revealed something interesting and
> enlightening anyway. Thanks to those who corrected my mistakes when I have
> posted incorrect answers. Performance based feedback is the fastest way to
> learn and oh boy, one can count on correction here <g>. Thanks to those who
> are tolerant of the over enthusiasm of the neophyte. Lastly, a very
> special thanks to those folks take the extra time to explain and teach in
> their posts. It is very much appreciated.
> Well, I have rambled on more than I intended. Have a great holiday.
>
> AmD
It feels good to be able to help, and feels great to know there are people out
there willing to help. Would a simple "thank you" ever be enough? I hope.
-TK
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4304
**************************************