[11980] in Perl-Users-Digest
Perl-Users Digest, Issue: 5580 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 6 11:07:16 1999
Date: Thu, 6 May 99 08:00:24 -0700
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, 6 May 1999 Volume: 8 Number: 5580
Today's topics:
Re: ==> REGEX, how do I use a variable as a seach patte (Larry Rosler)
a tail of two hashes roreilly@oxhp.com
Re: a tail of two hashes (Greg Bacon)
Re: apache 1.3.6 & mod_perl <gellyfish@gellyfish.com>
Re: deleting files <gellyfish@gellyfish.com>
Eliminating whitespace in middle <arm@home.net>
Re: Eliminating whitespace in middle (Sam Holden)
Re: Extracting Emails from TXT <gellyfish@gellyfish.com>
Re: having problems getting this script to work... (Larry Rosler)
Re: Help !!! (Tad McClellan)
Re: Help with Oracle Connection and SQL <rereidy@uswest.net>
how to round off numbers? lamj@softhome.net
Re: how to round off numbers? <gellyfish@gellyfish.com>
Re: how to round off numbers? (Cim)
Installing a Perl Bundle (PaulK)
Re: Installing a Perl Bundle (Sam Holden)
Re: ISPs that offer cgi space?? <gellyfish@gellyfish.com>
Re: ISPs that offer cgi space?? (Miles R. Fidelman)
Re: Man Pages in Windows NT <gellyfish@gellyfish.com>
Re: Newbie having problems getting this script to work. <jacklam@math.uio.no>
Re: pattern matching (Tad McClellan)
Re: PERL & Y2K <andy@theflat.dial.netmedia.co.uk>
Re: PERL & Y2K (I R A Aggie)
Re: Perl virus scanner? (I R A Aggie)
Re: processor time (Sam Holden)
Re: Q: checking defined/usable handles? <Wm.Blasius@ks.sel.alcatel.de>
Question: Win32:Registry <m.weindorf@mainz.netsurf.de>
Re: syswrite() lies (Larry Rosler)
Re: The Perl Index Project (Robert White)
TieRegistry and IIS CGI leighanthony@my-dejanews.com
Re: UNIX GUI Perl Debugger <shah@xnet.com>
Re: unos problemitas <camerond@mail.uca.edu>
Using LWP: getting the code for a website? (Joseph4829)
Re: What is the opposite of bind() ? (Tad McClellan)
Win32::AdminMisc::LogonAsUser problem mirak63@yahoo.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 6 May 1999 07:48:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: ==> REGEX, how do I use a variable as a seach pattern
Message-Id: <MPG.119b4b84c6fd88549899da@nntp.hpl.hp.com>
In article <37374547.5208098@news.skynet.be> on Thu, 06 May 1999
07:42:17 GMT, Bart Lateur <bart.lateur@skynet.be> says...
...
> Your string contains unquoted metacharacters: "+". You want to use '\+'
> in the pattern. Remember, and this is a serious pitfall, that you have
> to DOUBLE those backslashes. After all, when you print out the variable
> containing the pattern, it should look exactly as what you would have
> typed in directly. You want it to look like '\+', so you need to insert
> "\\+".
>
> $search= "<-(*.?)->|<\\+(*.?)\\+>";
It is easier to read (hence less error-prone) if you use single quotes
and single backslashes:
$search= '<-(*.?)->|<\+(*.?)\+>';
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 06 May 1999 13:31:04 GMT
From: roreilly@oxhp.com
Subject: a tail of two hashes
Message-Id: <7gs5io$qjj$1@nnrp1.deja.com>
Hi All,
I have written a couple of subroutines that return hashes.
%dmn = domain();
%dmnid = domainID();
domain() returns $domainnameID{domainname}
domainID() returns $databaseid{domainnameID}
I am trying to construct another hash that contains:
databaseid{domainname}
by binding the two hashes on the common domainnameID.
I have just ventured into the world of hashes and appreciate any help.
--regards
Robert Reilly
Oxford Health Plans
roreilly@oxhp.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 6 May 1999 14:09:59 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: a tail of two hashes
Message-Id: <7gs7rn$m1o$2@info2.uah.edu>
In article <7gs5io$qjj$1@nnrp1.deja.com>,
roreilly@oxhp.com writes:
: I am trying to construct another hash that contains:
:
: databaseid{domainname}
:
: by binding the two hashes on the common domainnameID.
: I have just ventured into the world of hashes and appreciate any help.
I find your question a little confusing. Maybe it would help if you
gave us a small example to illustrate what you're trying to do.
Greg
--
A little poison now and then: that makes for pleasant dreams. And
much poison at the end for a pleasant death.
-- Nietzsche
------------------------------
Date: 6 May 1999 14:02:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: apache 1.3.6 & mod_perl
Message-Id: <373192fb@newsread3.dircon.co.uk>
J.Orlowsky <SDK.DE@t-online.de> wrote:
> Jonathan Stowe schrieb:
>> J.Orlowsky <SDK.DE@t-online.de> wrote:
>> > my perl-scripts do not get any parameters, that are posted with the call
>> > of the scipts ?
>> > the scripts are running fine on my isp-servers and are running on my
>> > server, too.
>> > But I get no results
>> >
>> Lets guess - you have some hand-rolled piece of CGI form handling code
>> right ?
>>
>> You will need to read the documentatiom for mod_perl and its associated
>> modules. Alternatively you can use the module CGI.pm which handles
>> most of it relatively seamlessly.
>>
>
> the message-file of my apache server says:
> 10.0.0.2 -- [06/may/1999:12:59:19 -700] "POST
> /cgi-local/script.pl?function:calc+person:1 HTTP/1.0" 200 147
> an the script answers to my browser, that it doesn't get any parameters.
>
<big snip>
> I don't know, why it doesn't work and I've read many manuals.
>
But have you read the documentation for mod_perl ?
The point is that the module CGI.pm does some special checking for
mod_perl :
# Turn on special checking for Doug MacEachern's modperl
if (exists $ENV{'GATEWAY_INTERFACE'}
&&
($MOD_PERL = $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl\//))
{
$| = 1;
require Apache;
}
The reason for this is that in reality your CGI program is no longer
running under CGI and this module takes some steps to adequately emulate
that environment. If you are not using the module CGI.pm then you
will have to take those steps yourself. If you dont want to have to
alter your programs so that they will no longer run in a non-mod_perl
environment you will either have to use CGI.pm or you will have to run
them from a location that does not cause them to run within mod_perl but
as normal CGI programs - how you will do that is not a question for this
group but one for comp.infosystems.www.servers.unix.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 6 May 1999 13:36:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: deleting files
Message-Id: <37318cc1@newsread3.dircon.co.uk>
Wyzelli <wyzelli@yahoo.com> wrote:
> Bob Trieger <sowmaster@juicepigs.com> wrote in message news:7gqon9>
>> perldoc -f unlink
>>
> I am using Activeperl 5.005
>
> When I run the above command I get:
>
> No documentation found for "perlfunc"
>
> Is this a known problem with the documentation on windoze?
>
No. It works fine for me. It is possible that perlfunc.pod has
been moved from the place where perldoc will look for it.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 06 May 1999 13:28:19 GMT
From: Alan Melton <arm@home.net>
Subject: Eliminating whitespace in middle
Message-Id: <373198E8.A21FC134@home.net>
I know how to eliminate whitespaces at the beginning
and end of a field but how do you eliminate a whitespace
in the middle of a field:
i.e. MED 2000 ----> MED2000
------------------------------
Date: 6 May 1999 13:34:45 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Eliminating whitespace in middle
Message-Id: <slrn7j36jl.lh6.sholden@pgrad.cs.usyd.edu.au>
On Thu, 06 May 1999 13:28:19 GMT, Alan Melton <arm@home.net> wrote:
>I know how to eliminate whitespaces at the beginning
>and end of a field but how do you eliminate a whitespace
>in the middle of a field:
>
>i.e. MED 2000 ----> MED2000
How do you eliminate it from the beginning?
How do you eliminate it from the end?
What does the documentation say about the code that you use to do that?
Now read the documentation on whatever you used to eliminate it from
the beginning or end and see if you can modify it to remove from the
middle.
Now have a look at the documentation for 'tr' - it's a perl operator that
might do what you want.
If you still have trouble, post the code of your attempt here, and
people will be able to help you.
--
Sam
PC's are backwards ... throw them out! Linux is ok though.
--Rob Pike (on the subject of CR/LF etc)
------------------------------
Date: 6 May 1999 14:25:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Extracting Emails from TXT
Message-Id: <37319855@newsread3.dircon.co.uk>
joeyandsherry@mindspring.com wrote:
>
> I've been struggling with a script to extract emails from a txt file. Is
> there a way?
>
Sorry I dont know what you mean. Do you mean you want to extract
individual messages from a mailbox file - In which case there is most
probably a module on CPAN. Or do you mean you want to extract email
*addresses* from some arbitrary text file - in that case you are going
to have to come up with a pretty plausible story before anyone will tell
you.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 6 May 1999 07:32:12 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: having problems getting this script to work...
Message-Id: <MPG.119b47c22e8f3cfe9899d9@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <373847a3.5812657@news.skynet.be> on Thu, 06 May 1999
07:41:48 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> Larry Rosler wrote:
> >But neither of them is the fastest, as Bart Lateur's approach is the
> >clear winner. I'll have to use it more often.
>
> Then will you test my alternative?
>
> {
> local $\ = "\n";
> print OUT foreach @data;
> }
Is your computer busted? I posted the benchmark code, as always, and
several others have already posted variants.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 6 May 1999 04:35:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help !!!
Message-Id: <09krg7.hi6.ln@magna.metronet.com>
Ian Marran (ian@epages.net) wrote:
: Subject: Help !!!
Please put the subject of your article in the Subject header
of your article.
: I need to convert rich text to html
: in a perl script in an ASP page.
A search at AltaVista for +rtf2html
finds over 800 hits
searching fro +rtf2html +Perl
finds 100 hits
Using a search engine when what you want to do is search
is a Really Good Idea.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 06 May 1999 05:40:52 -0600
From: Ron Reidy <rereidy@uswest.net>
Subject: Re: Help with Oracle Connection and SQL
Message-Id: <37317FC4.81E2733A@uswest.net>
This is a multi-part message in MIME format.
--------------4A630C9785A06A848D76ED7D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Get DBI/DBD:Oracle from CPAN. In there are all sorts of examles and
documentation on how to do it.
rr
Eugene Katzman wrote:
> Hi
> I just completed writing a C program for compiling with the ProC
> precompiler.
> Now I find that I can no longer access the Precompiler. I need to write
> the same program in Perl.
> What I need to know is what I have to post as #include or use ie use
> ORALIB
> the other thing I need to know is what has to preceed the SQL like
> EXEC SQL
> or
> SQLPLUS and how do I get the Oracle statements to execute out of the
> program to wherever it needs to go and how to run the connect operation.
>
> With Pro C I use EXEC SQL begin declare section;
> varchar userid[10], password[15];
> EXEC SQL end declare section;
> after some logic to obtain userid and passwd,
> EXEC SQL connect :userid identified by :password;
> if (sqla.sqlcode != 0)
> fprintf(stderr, "Failed");
> etc
> How is it done in Perl, do you use the sqlca structure for returning
> values. How does one get data returned from a select statement, ie
> EXEC SQL select idnum into :peridnum from table1 where columnb equals
> tempvalue;
>
> Thanks a lot
>
> Gene Katzman e.katzman@stanleyassoc.com (703)739-8559x232
--------------4A630C9785A06A848D76ED7D
Content-Type: text/x-vcard; charset=us-ascii;
name="rereidy.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ron Reidy
Content-Disposition: attachment;
filename="rereidy.vcf"
begin:vcard
n:Reidy;Ron
x-mozilla-html:FALSE
org:Reidy Consulting, L.L.C.
version:2.1
email;internet:rereidy@uswest.net
title:Owner
x-mozilla-cpt:;0
fn:Ron Reidy
end:vcard
--------------4A630C9785A06A848D76ED7D--
------------------------------
Date: Thu, 06 May 1999 12:55:52 GMT
From: lamj@softhome.net
Subject: how to round off numbers?
Message-Id: <7gs3gm$ok5$1@nnrp1.deja.com>
I am trying to round off some numbers from say 123.123456 to 123.12, I know I
can do it by printf but what is the syntax format? Something like (wild guess)
printf("This is the number %.2f", $number, "and it is rounded"); ??
Jason Lam
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 6 May 1999 14:33:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to round off numbers?
Message-Id: <37319a0e@newsread3.dircon.co.uk>
lamj@softhome.net wrote:
> I am trying to round off some numbers from say 123.123456 to 123.12, I know I
> can do it by printf but what is the syntax format? Something like (wild guess)
> printf("This is the number %.2f", $number, "and it is rounded"); ??
>
What happened when you tried it ?
You ought to check out perlfaq4:
Does Perl have a round() function? What about ceil() and floor()?
Trig functions?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 06 May 1999 14:54:31 GMT
From: cim@online.ee (Cim)
Subject: Re: how to round off numbers?
Message-Id: <3732ac01.98382674@news.uninet.ee>
On 6 May 1999 14:33:02 +0100, Jonathan Stowe <gellyfish@gellyfish.com>
wrote:
>What happened when you tried it ?
>
>You ought to check out perlfaq4:
>
> Does Perl have a round() function? What about ceil() and floor()?
> Trig functions?
Actually I have a similar problem. ceil() rounds 3.123 to 4 and
floor() to 3. But i need one that does it like round() function in
Excel - if it's 3.4 it rounds to 3 and if it's 3.6 it rounds to 4.
?
cim.
------------------------------
Date: Thu, 06 May 1999 13:51:03 GMT
From: paul@vdkamer.nl (PaulK)
Subject: Installing a Perl Bundle
Message-Id: <37319e3b.27469515@news.wxs.nl>
This is prob. a faq but i can't find it.
I'll like to use LWP on my ISP server.
I know i can install the hole package with the following command
perl -MCPAN -e 'install Bundle::LWP'
is it also possible to run this script not as root ?
and is it possible to get the installation of LWP and other modules
not in the standard perl dir but in a dir which i can use (write to)?
Thanks for replying.
Paul van de Kamer
------------------------------
Date: 6 May 1999 14:04:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Installing a Perl Bundle
Message-Id: <slrn7j38b6.ov0.sholden@pgrad.cs.usyd.edu.au>
On Thu, 06 May 1999 13:51:03 GMT, PaulK <paul@vdkamer.nl> wrote:
>This is prob. a faq but i can't find it.
You could try having a look. It's hard to find things without
looking first.
You wrote 'other modules' in your post so you know the name perl
uses.
Why don't you do a word search for 'module' on the FAQs. Even just
searching the titles would find the one your looking for.
You obviously have a different definition of "can't find" then I do.
<snip actual question about installing not as root>
--
Sam
the Emacs editor is horrible
--Linus Torvalds
------------------------------
Date: 6 May 1999 14:20:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ISPs that offer cgi space??
Message-Id: <3731973b@newsread3.dircon.co.uk>
BBlackmoor <bblackmoor@my-dejanews.com> wrote:
> In article <372FF4EC.A5FC65E@chatbase.com>,
> webmaster@chatbase.com wrote:
>>
>> ...take it into private emails -- where flames belong...
>
> A curious statement, since I was chastising you and others for flaming
> someone who asked a perfectly reasonable question.
>
Sorry am I missing something here. The original poster asked about
ISPs that offer CGI space. No mention of Perl whatsoever. It has been
the contention of everyone else in this thread apart from yourself that
this question would better be asked somewhere where matters concerning
ISPs are generally discussed.
Anyhow I'm with Tad :
*plonk*
And I would encourage anyone else who might be reading to check you out
on DejaNews and make there own minds up.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 6 May 1999 14:42:39 GMT
From: fidelman@world.std.com (Miles R. Fidelman)
Subject: Re: ISPs that offer cgi space??
Message-Id: <FBBFJ3.FJ2@world.std.com>
Mike Flaherty (mflaherty2@earthlink.net) wrote:
: I haven't looked yet but this seems like to best place to start.
: I am looking to start a web site for public use. I know there are plenty
: of ISPs that offer web space - even for free. However, I want to use CGI
: scripts and I will need access to a command line in order to develop/debug
: them. This is a non issue for the stuff I write at work but do commercial
: ISPs allow that kind of access?
Shorenet (www.shore.net) does - at least for virtual hosts (definitely not
free though).
You might also try asking on:
comp.infosystems.www.servers.unix
comp.infosystems.www.authoring.cgi
------------------------------
Date: 6 May 1999 14:48:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Man Pages in Windows NT
Message-Id: <37319dc0@newsread3.dircon.co.uk>
Martijn van der Kooij <DeleteThisdev@stabiplan.nl> wrote:
> Probably off topic, but i'm wondering how I can view man files in Windows
> NT.
>
> Has someone the source of the man utility, or does someone know where to
> start searching?
Yes this is totally off-topic but I would start looking at:
<http://oak.oakland.edu/pub/simtelnet/gnu/djgpp/v2gnu/>
Actually there isnt a 'man' port there but gnu 'info' however you could
easily cobble one with 'groff' and 'less'.
>
> (BTW Are there utilities to create man pages for Windows NT ?)
>
Er an editor ? <http://reference.perl.com/query.cgi?editors>
Alternatively you could start by creating your docs in Perl's POD
format and then use pod2man on them.
Read the perlpod documentation for more on that.
i/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Thu, 06 May 1999 15:15:07 +0200
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: Newbie having problems getting this script to work...
Message-Id: <373195DA.55E4D100@math.uio.no>
Robert White wrote:
>
> (...)
>
> $myarray = ~s/33_/ /g; # Remove the 33_ prefix from filename
Firstly, this removes EVERY occurence of "33_" in $myarray and
not only the first. Secondly, it replaces every "33_" with a " ".
If you want to remove a "33_" prefix, use
$myarray =~ s/^33_//;
Peter
--
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
------------------------------
Date: Thu, 6 May 1999 03:46:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: pattern matching
Message-Id: <1dhrg7.ih6.ln@magna.metronet.com>
Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote:
: Riemann Medici <revjack@radix.net> wrote:
: > TRG Software : Tim Greer explains it all:
: >
: > [snip o' doom]
: >
: > You talk too much.
: >
: > *plonk*
: You plonk too much.
: *plonk*
You are much too much.
: (Sorry, couldn't resist! ;)
Me either.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 06 May 1999 14:35:19 +0100
From: Andrew MacInnes <andy@theflat.dial.netmedia.co.uk>
Subject: Re: PERL & Y2K
Message-Id: <37319A97.4F36B6F0@theflat.dial.netmedia.co.uk>
I R A Aggie wrote:
>
> On Wed, 28 Apr 1999 21:36:25 -0400, Bill Jones
> <bill@fccj.org>, in <3727b7a5.0@usenet.fccj.cc.fl.us> wrote:
>
> + What is REALLY scary is that I got e-mailed 'spam' from
> + some company (unravel.com, I believe) saying they had
> + a perl code scanner which helps you fix all perl Y2k issues.
>
> + They charge a $3,000 if I remember correctly.
>
> + I e-mailed them back and asked "So, it is a programmer mind reader?"
> + The guy mailed me back and said people are buying it.
>
> OH DEER LORD.
The best product for helping with Y2K issues is...
Y2K-Y Jelly,
Allows four digits where only two were previously possible.
Andy
--
- RAL, ITD, E-mail:A.G.MacInnes@rl.ac.uk -
- R27 - F31 Telephone (Direct): (01235)446104 -
- Chilton, Didcot Telephone (Mobile): 07775 943273 -
- Oxon, OX11 0QX http://www.itd.clrc.ac.uk -
------------------------------
Date: 6 May 1999 14:05:48 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: PERL & Y2K
Message-Id: <slrn7j38iq.78v.fl_aggie@stat.fsu.edu>
On Thu, 06 May 1999 14:35:19 +0100, Andrew MacInnes
<andy@theflat.dial.netmedia.co.uk>, in
<37319A97.4F36B6F0@theflat.dial.netmedia.co.uk> wrote:
+ The best product for helping with Y2K issues is...
+
+ Y2K-Y Jelly,
+
+ Allows four digits where only two were previously possible.
Personal Foul! Unnecessary Visualizations! Give 'im the red card!
James
------------------------------
Date: 6 May 1999 13:33:43 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl virus scanner?
Message-Id: <slrn7j36ml.6s7.fl_aggie@stat.fsu.edu>
On Thu, 06 May 1999 12:56:30 GMT, Peter van der Landen <landen@frg.eur.nl>, in
<373490ac.2336041590@zeus.safenet.nl> wrote:
+ Do yourself a favor, buy a professional Linux virus scanner (several
+ vendors have one, NAI is one of them).
NAI spams. Don't patronize spammers.
[wrapped, this all should be one line]
http://www.dejanews.com/[ST_rn=ps]/dnquery.xp?ST=PS&QRY=NAI&defaultOp=AND
&DBS=1&format=terse&showsort=score&maxhits=25&LNG=ALL&subjects=
&groups=news*net-abuse*&authors=&fromdate=&todate=
James
------------------------------
Date: 6 May 1999 13:11:57 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: processor time
Message-Id: <slrn7j358t.juq.sholden@pgrad.cs.usyd.edu.au>
On Thu, 06 May 1999 07:11:39 -0500, Todd Smith <tbsmith@viper.net> wrote:
>How can i make a program that does infinite loops not use 99% of the
>processor?
Set it's priority appropriately. That's OS specific though so you'll
have to provide more info or ask somewhere else for how to do that.
Under unix you can use 'nice'.
If you want your program to delay for some time and you have implemented
that with an infinite loop then you should change it to use
sleep if that is not fine grained enough then look up select.
perldoc -f sleep
perldoc -f select
You really shouldn't need a busy loop. Unless your program is doing
something like generating mandellbrot sets or something...
--
Sam
If your language is flexible and forgiving enough, you can prototype
your belief system without too many core dumps.
--Larry Wall
------------------------------
Date: Thu, 06 May 1999 15:55:28 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
To: Sebastian Frankfurt <sf@tellux.de>
Subject: Re: Q: checking defined/usable handles?
Message-Id: <37319F50.446B9B3D@ks.sel.alcatel.de>
Sebastian Frankfurt wrote:
>
> William Blasius #42722 wrote:
> >
> >
> > DESCRIPTION
> > The IO::Select package implements an object approach to the
> > system select function call. It allows the user to see what
> > IO handles, see the IO::Handle manpage, are ready for
> > reading, writing or have an error condition pending.
> >
> > So:
> >
> > $rin = "";
> > vec($rin, fileno($p_out), 1) = 1 if defined fileno($p_out);
> > if select( $rout=$rin, undef, $eout=$rin, 0) {
> > $rout ? syswrite $p_out "some nice output\n" : die "some nasty
> > error";
> > };
> >
>
> Well, I've tested this twice and it does not work. Don't hurt me ;-)
> but I don't know why...
>
> I've used the code above and it does _not_ work... the select
> returns '-1' if the handle exists and '-1' if not.
>
oops, there were a couple of errors in that code - I can only plead
the late hour and a long day. I just ran this here (5.004/Solaris):
use strict;
use FileHandle;
my $p_out = new FileHandle;
open $p_out, ">&STDOUT";
$p_out->autoflush(1);
my ($win, $wout, $eout);
vec($win, fileno($p_out), 1) = 1 if defined fileno($p_out);
if ( 0 < select( undef, $wout=$win, $eout=$win, 0 ) ) {
$wout ? print $p_out "some nice output\n" : die "some nasty error";
} else {
print "no select\n";
}
and it prints 'some nice output'. Select(2) normally returns -1 for
an error. Do you get an error in $! - like 'Bad file number'? IMHO,
you will get strange results in you select a closed fh - the result
bitstring is set to the input bitstring and confusion is likely the
result, so don't do that! ;-)
If you can't run that code snippet, let us know the results.
hth,
Wm Blasius
Stuttgart
---
...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!
------------------------------
Date: Thu, 6 May 1999 15:47:29 +0100
From: "Matthias Weindorf" <m.weindorf@mainz.netsurf.de>
Subject: Question: Win32:Registry
Message-Id: <37319f5b.0@juno.wiesbaden.netsurf.de>
Dear Perlers,
has anyone had ever following problem?
I'm calling continuesly a selfmade lib, which reports the value from a
registry key to $value.
If $value is only once reported with a value and the I call a registry path
that not exists I get always the last $value back.
But I want to check the existence of a reg-key!
my lib:
# file name: QueryHKLMKey.pl
# created: 06\15\1998
# modified: 06\15\1998
# requirements:
# discription:
# Sample Call
# $LocVal = QueryHKLMKey($LocPath, $LocValue);
# | | |
# | | |-Value Name
# | |
# | |-Registry Path
# |
# |-Value Data of Value Name
#
# Returns the Value of the Value name.
# Value is a Value Name in the HKLM Registry path.
package QueryHKLMKey;
sub main'QueryHKLMKey {
require "NT.ph";
use Win32::Registry;
my ($path, $key) = @_;
my $value;
Win32::RegOpenKeyEx( &HKEY_LOCAL_MACHINE, $path,$type, &KEY_ALL_ACCESS,
$LocalHandle);
Win32::RegQueryValueEx($LocalHandle, $key, 0 ,$type , $value);
return $value;
}
1;
1. if I call with regpath that not exist -> I get as $value=''
2. if I call with real regpath -> I get as $value="realvalue"
3. if I call with regpath that not exist -> I get as $value="realvalue"
Who can give me some suggestions or fixes ?
does anyone know a workaround ?
thanks
Matthias
--
---------------------------------------------
Matthias Weindorf
m.weindorf@mainz.netsurf.de
cellfon 0170 226 2240
cellfax 0170 13 226 2240
------------------------------
Date: Thu, 6 May 1999 07:28:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: syswrite() lies
Message-Id: <MPG.119b46e6318de24e9899d8@nntp.hpl.hp.com>
In article <slrn7j2vg4.b8v.sholden@pgrad.cs.usyd.edu.au> on 6 May 1999
11:33:24 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> says...
...
> This can't be fixed in perl. Since then syswrite would be broken for
> those who want to use it to write a text file.
>
> The function does work. It works as documented. binmore also works. It also
> works as documented. The problem is that the platform that requires the
> use of binmode, is the platform which has the highest proportion of
> people who don't bother reading the documentation to find out.
>
> I'll just say again. The brokeness is not perl's problem, and can not
> be fixed by perl. It is a 'feature' of the platform.
It *can* be fixed -- in Perl documentation -- just as it has been
'fixed' in the C Standard. When one opens a binary file using C, one
uses mode "ab" or "rb" or "wb". When one opens a binary file using
Perl, one uses binmode(). Period. That is The Way To Do It!
Nowhere in the paragraph above does the word 'platform' appear (nor the
words 'broken' or 'brain-dead'). Programs that don't use binmode() are
not portable. Period.
Perl writers and teachers can eliminate this problem once and for all
(at least for newcomers to Perl), at the cost of instructing people
*always* to include a line of code that happens to be a no-op in some
environments. binmode() should appear in every book and in every
tutorial and in every snippet as The Way To Do It. Period. Then even
"people who don't bother reading the documentation to find out" will use
it naturally, just as they use open().
The C Standard is by design platform-independent. The Unix origins of
the C Library are quite apparent, but the functions are documented for
program portability. So should Perl functions be! (If there were to be
a Perl Standard and I were to be on the Technical Committee, they would
be. But don't anyone hold their breath until that happens. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 06 May 1999 03:58:27 GMT
From: richly@samart.co.th (Robert White)
Subject: Re: The Perl Index Project
Message-Id: <3730f5d3.6779803@news.samart.co.th>
, silver <silver@silverchat.com> wrote:
>Phase 3: The Boring Part
>Then I start typing. A lot. And hopefully get contributions from the
typing? you're Mad
If you can get permission to use it they'll email you the whole book
>Would you use this? Would you contribute? Do you think it's a good idea, or
>the dumbest thing you've ever heard?
I've heard dumber things.
I've also got more Perl documentation than I can use,,,, I just found
a whole ebook I'd forgotten about.
Snippets of code and function references ain't gonna help much but
If you scale it down a bit and provide an index to the larger chunks
available in books, magazine articles and on CSPAN and annotate them
properly it could be useful.
For instance there's a functioning script that does a yahoo like
interface called perlhoo. Someone will want to do something like that
somewhere sometime so if you provide a way to look for it That could
be useful.
just my 2 baht
Robert Just another perl hacker in Bangkok
http://bangkokwizard.hypermart.net/perl.html
------------------------------
Date: Thu, 06 May 1999 14:09:04 GMT
From: leighanthony@my-dejanews.com
Subject: TieRegistry and IIS CGI
Message-Id: <7gs7ps$sno$1@nnrp1.deja.com>
Hello,
Can anyone help with this one?
ActiveState Perl build 515
IIS 4.0
NT 4
I have a script which uses TieRegistry and it works fine from the
command-line. I have the following in my script:
$tiedvr=$Registry->{"HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W3SVC/
Parameters/Virtual Roots/"};
$keys = keys %$tiedvr;
>From the command-line, everything works fine; I get the number of virtual
roots for the web server, and all associated data. When the script is run as
a CGI script, $keys always ends up as zero and keys %$tiedvr is empty.
It would appear that IIS is broken as the same script runs happily under
apache-win32. I just can't work out why or how IIS would break it. Has
anyone seen this before or know of a work-around? Am I missing something
blindingly obvious?
Leigh
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 6 May 1999 14:39:11 GMT
From: Hemant Shah <shah@xnet.com>
Subject: Re: UNIX GUI Perl Debugger
Message-Id: <7gs9if$1oo$1@flood.xnet.com>
While stranded on information super highway Daniel Grisinger wrote:
:)"Keith A. Humphrey" <keith.a.humphrey@ac.com> writes:
:)> Are there any GUI Perl debuggers for a HPUX system ?
:)xemacs
:)dgris
:)--
:)Daniel Grisinger dgris@moiraine.dimensional.com
:)perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
:)m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
DDD is the data display debugger.
For details, see the DDD World-Wide-Web page,
`http://www.cs.tu-bs.de/softech/ddd/',
or send a mail to the DDD developers <ddd@ips.cs.tu-bs.de>.
It debugs, C, perl, python, etc.
--
Hemant Shah /-------------------\ ^~~~~^
E-mail: NoJunkMailshah@xnet.com |TECHNOLOGY | | |
|No place for wimps | o|-OO-|o
TO REPLY, REMOVE NoJunkMail | -Dilbert |--- | () |
FROM MY E-MAIL ADDRESS. \-------------------/ | |
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Thu, 06 May 1999 08:39:10 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: unos problemitas
Message-Id: <37319B7E.95E92D76@mail.uca.edu>
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, bart.lateur@skynet.be (Bart Lateur) writes:
> : open (FILE, ">$fn") || print "Problemo: $!";
>
> Cool -- a new language! "problemo" is not a word in any language I have
> ever heard of. What language was that?
>
> [etymology lesson snipped]
Well, I don't find "modulo" in Webster's (or Cassell's), either, but you
seem to find it used around here quite a bit. ;)
BTW, "problemo" predates the Simpsons or other TV shows I've seen listed
in this thread by quite a few years. I remember hearing/using it 35-40
years ago, when I was a kid. Pig-Spanish, I think.
Cameron
--
Cameron Dorey
camerond@mail.uca.edu
------------------------------
Date: 6 May 1999 14:55:54 GMT
From: joseph4829@aol.com (Joseph4829)
Subject: Using LWP: getting the code for a website?
Message-Id: <19990506105554.07407.00000059@ng-cr1.aol.com>
How can I make this simple when all I want is the end product ($code) ? I want
to speed it up. I could really care less about the Netscape stuff.
use LWP::UserAgent;
use LWP::Simple;
$url = "$siteurl";
my $ua = LWP::UserAgent->new();
$ua->agent("Netscape");
my $req = HTTP::Request->new(GET => $url);
$req->referer("http://www.netscape.com");
my ($req) = new HTTP::Request ('HEAD', $url);
my ($res) = $ua->request($req);
$code = $res->code;
------------------------------
Date: Thu, 6 May 1999 04:12:12 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: What is the opposite of bind() ?
Message-Id: <ssirg7.hi6.ln@magna.metronet.com>
Kenny McCormack (gazelle@yin.interaccess.com) wrote:
: In article <7gqkdt$t8l$1@fir.prod.itd.earthlink.net>,
: Bob Trieger <sowmaster@juicepigs.com> wrote:
: >tadmc@metronet.com (Tad McClellan) wrote:
: >>Kenny McCormack (gazelle@yin.interaccess.com) wrote:
: >>
: >>: I have a Perl script that is a variation of the server program in the book.
: >> ^^^^^^^^
: >>
: >> I didn't know that the Bible had Perl code in it.
: >>
: >If the Bible was written in perl would JC have used s/ater/ine/ to turn
: >"water" into "wine"?
: >
: >Sort of leaves me wondering if they would have lost the body if they
: >used this line:
: >
: >close CAVE or die "Hey Pontius! The cave did not close: $!";
: Thank you for totally derailing this thread.
The point being that you are the only person who knows
what book you are using, hence what code you are using.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 06 May 1999 14:42:23 GMT
From: mirak63@yahoo.com
Subject: Win32::AdminMisc::LogonAsUser problem
Message-Id: <3731a28a.264888761@news.mindspring.com>
I am experiencing problems using the LogonAsUser function. I can
connect to servers in my home domain. However, I fail to connect when
I cross domains. When I check between my $user and $username
variables, $username still equals the ID I logged into my computer
with, not USER as it should. The output looks like
failed to logon
USER
MyCurrentLogon
Below is the code.
Thanks,
Karim
$domain="DOMAIN";
$user="USER"'
$password="PASSWORD";
use Win32::AdminMisc;
Win32::AdminMisc::LogonAsUser($domain,$user,$password);
$username=Win32::AdminMisc::GetLogonName();
print "Failed to logon\n" if ("\L$user" ne "\L$username");
print "$user";
print "$username";
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5580
**************************************