[12365] in Perl-Users-Digest
Perl-Users Digest, Issue: 5965 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 11 18:07:22 1999
Date: Fri, 11 Jun 99 15: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 Fri, 11 Jun 1999 Volume: 8 Number: 5965
Today's topics:
Re: Access to mail content <gellyfish@gellyfish.com>
Accessing characters in a string? (SMS/Christian Fowler)
Re: Accessing characters in a string? <alan@ultra.finchcomputer.com>
Re: Accessing characters in a string? <cassell@mail.cor.epa.gov>
Re: Accessing characters in a string? (Larry Rosler)
Re: Calculating weekday given year, month and day <e.h.bogart@larc.nasa.gov>
Re: comparing substrings of array values <aqumsieh@matrox.com>
Re: dimensions of a jpg file <gellyfish@gellyfish.com>
File Locking <msanders@thetangledweb.net>
Re: File Locking <craig@mathworks.com>
Re: File Locking (Larry Rosler)
Re: File upload/download Web app. <gellyfish@gellyfish.com>
GIFgraph output to web page <k.l.marlowe@larc.nasa.gov>
Re: how to read excel file ? <gellyfish@gellyfish.com>
HTTP protocol etc. (George)
Re: HTTP protocol etc. <craig@mathworks.com>
Re: HTTP protocol etc. (brian d foy)
Re: I'm really peaved off! <gellyfish@gellyfish.com>
Re: installing modules <cassell@mail.cor.epa.gov>
Re: Linus Torvalds and Carmen Electra? <gbartels@xli.com>
Re: mod_perl require problem <jason@eggnet.com>
Re: NT Perl - .plx work, .pl don't <gellyfish@gellyfish.com>
Re: Out of Memory!!! (IzB.)
Perl and WinNT services (Bill Thompson)
Re: Perl and WinNT services <cassell@mail.cor.epa.gov>
Re: Perl class and constructor <gellyfish@gellyfish.com>
Re: Perl class and constructor <aqumsieh@matrox.com>
perl oracle speed question mark_f_edwards@my-deja.com
Perl Parser for JavaScript and VBScript wanted <juex@my-dejanews.com>
Re: Please Help!! <gellyfish@gellyfish.com>
Re: Require "No NT commands" on UNIX <gellyfish@gellyfish.com>
setting group ownership of a directory from perl <mikej@1185design.com>
Re: setting group ownership of a directory from perl (brian d foy)
Re: Verifying date data gsherman2773@my-deja.com
Which .gz file to download for Net::Cmd.pm ? dwang999@my-deja.com
Re: Which .gz file to download for Net::Cmd.pm ? (I R A Aggie)
which .tar.gz file contains Net::Cmd.pm? dwang999@my-deja.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Jun 1999 20:02:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Access to mail content
Message-Id: <7jrq0o$ig$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 01:47:13 GMT paul@bagend.wurley.net wrote:
>
>
> Hi,
>
> I am new to perl programming and was hoping to get some assistance with
> the following project. I would like to estabalish an email account that
> accepts share prices. The data would be submitted in a standard format.
> When a new message arrives I would like to have a perl program that
> takes the content of the message and writes this to a text file. Could
> someone please give me a pointer to how I would access the mail
> message. THe box I am using is running linux and sendmail...
>
You might want to look at either the Mailtools or Mailfolder packages
of modules available from CPAN:
http://www.perl.com/CPAN/authors/id/GBARR/MailTools-1.13.tar.gz
http://www.perl.com/CPAN/authors/id/KJOHNSON/MailFolder-0.07.tar.gz
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Jun 1999 20:00:48 GMT
From: sms@links.magenta.com (SMS/Christian Fowler)
Subject: Accessing characters in a string?
Message-Id: <7jrptg$328$1@links.magenta.com>
I am trying to parse through a scalar with a string in it. How does I
access the n'th character? I am looking for the perl equivalent of
char c = myString[n];
Sorry if this is obivious, my nutsheell book didn't seem to have an
answer.
Thanks for any help!
--
=-=
=-=%=-= Christian Fowler | cfowler@magenta.com
=-=
------------------------------
Date: 11 Jun 1999 13:48:57 -0700
From: Alan Petersen <alan@ultra.finchcomputer.com>
Subject: Re: Accessing characters in a string?
Message-Id: <ygcyahq8nuu.fsf@ultra.finchcomputer.com>
sms@links.magenta.com (SMS/Christian Fowler) writes:
> I am trying to parse through a scalar with a string in it. How does I
> access the n'th character? I am looking for the perl equivalent of
>
> char c = myString[n];
>
> Sorry if this is obivious, my nutsheell book didn't seem to have an
> answer.
>
> Thanks for any help!
>From the perlfunc man page:
substr EXPR,OFFSET,LEN
Extracts a substring out of EXPR and returns it.
First character is at offset 0, or whatever you've
set $[ to (but don't do that). If OFFSET is
negative, starts that far from the end of the
string. If LEN is omitted, returns everything to
the end of the string. If LEN is negative, leaves
that many characters off the end of the string.
You can use the substr() function as an lvalue, in
which case EXPR must be an lvalue. If you assign
something shorter than LEN, the string will shrink,
and if you assign something longer than LEN, the
string will grow to accommodate it. To keep the
string the same length you may need to pad or chop
your value using sprintf().
For example:
$c = substr $myString,$n,1;
- alan
------------------------------
Date: Fri, 11 Jun 1999 14:06:56 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Accessing characters in a string?
Message-Id: <37617A70.450B81D7@mail.cor.epa.gov>
SMS/Christian Fowler wrote:
>
> I am trying to parse through a scalar with a string in it. How does I
> access the n'th character? I am looking for the perl equivalent of
>
> char c = myString[n];
>
> Sorry if this is obivious, my nutsheell book didn't seem to have an
> answer.
Perl works at a little higher level than C, so you may need
a little mind-adjustment in places. No problem. You want
substr() . You can find out all about it in the perlfunc manpage
(which you can read with perldoc if you prefer). Also check
out index() and rindex(), which may come in handy too.
> Thanks for any help!
Okay, then here's another little tip. Type this at a command
prompt:
perldoc perl
You should get a list of manpages, and a suggested reading
order. You'll get a lot out of them. Perl has great
documentation. You just have to find the time to read it. :-)
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 11 Jun 1999 14:05:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Accessing characters in a string?
Message-Id: <MPG.11cb1a106f776b6f989bc5@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7jrptg$328$1@links.magenta.com> on 11 Jun 1999 20:00:48 GMT,
SMS/Christian Fowler <sms@links.magenta.com> says...
> I am trying to parse through a scalar with a string in it. How does I
> access the n'th character? I am looking for the perl equivalent of
>
> char c = myString[n];
>
> Sorry if this is obivious, my nutsheell book didn't seem to have an
> answer.
Get a better book!
perldoc -f substr
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 11 Jun 1999 15:37:20 -0400
From: Ed Bogart <e.h.bogart@larc.nasa.gov>
Subject: Re: Calculating weekday given year, month and day
Message-Id: <3761656F.AF819D96@larc.nasa.gov>
Gregory Snow wrote:
>
> In article <7jq986$7g1$1@nnrp1.deja.com>, <perl_beginner@my-deja.com> wrote:
> > what is the most efficient way to calculate the weekday (sunday=0,
> >monday=1 ...) given the year, month, and day without using the module
> >provided by perl (i.e using arithmatics and algorithm)? Any suggestion?
> >
>
> Another approach (that doesn't require any modules and the overhead
> that comes with them) is:
>
> $day_of_week = ( dmy_to_julian( $day, $month, $year ) + 1 ) %7;
>
> where dmy_to_julian is a good julian day converter (I use the one
> available at the Perl Function Repository:
> http://moiraine.dimensional.com/~dgris/perl/pfr/ ).
>
Well I tried it and got;
Undefined subroutine &main::dmy_to_julian called at TestIF line 10.
Line 10 is "$day_of_week = ( dmy_to_julian( $day, $month, $year ) + 1 )
%7"
And, wouldn't this only work for years that start on Sunday, I.e. julian
day 1 is Sunday? Which reminds me of a long story about calendars that
my wife made me promise never to tell. 8=)
Ed
------------------------------
Date: Fri, 11 Jun 1999 15:52:01 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: comparing substrings of array values
Message-Id: <x3y909qcy73.fsf@tigre.matrox.com>
Markus Banach <h0444vcs@rz.hu-berlin.de> writes:
> I have an array of string values and
> I want to compare a substring of these strings.
>
> # an @bernd array with string values exists
>
> $y = 1;
>
> for ($i = 0; $i <= $x ; $i++) {
What is $x?
> if ( $bernd[$i] eq $bernd[$i+1] ) {
> # at this stage the substrings instead of the whole string
> # should be compared
> # the substring starts with any single digit or letter and ends
> # with the first space char, in other words :
> # $_ =~ /^[a-zA-Z0-9]*\s/
>
> # if true, $bernd[$i] and $bernd[$i+1] should get the same $y number
>
> # (starting from 1) at the beginning
> }
>
> else {
> #increase the $y
> $y++;
Don't you think that your last comment 'increase the $y' is pretty
useless here? Comments are good only when they are
necessary. Otherwise they are only clutter (IMHO of course).
If you would like a good read on the practice of
programming, then you should check out the new book by Kernighan and
Pike titled 'The Practice of Programming.' I enjoyed it.
> # $bernd[$i+1] gets the new $y
> # compare substrings of $bernd[$i+1] and $bernd[$i+2] ...
> }
>
> }
>
> Does someone of you know how that works ?
How what works? What is your question exactly?
> Thank you very much for your consideration !
> I' m looking forward to your response !
I don't quite understand what your question is. Please rephrase your
inquiry and post again.
Regrads,
Ala
------------------------------
Date: 11 Jun 1999 21:07:46 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: dimensions of a jpg file
Message-Id: <7jrtr2$ke$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 10:40:01 -0400 Deamon George Scapin wrote:
> Tom Phoenix wrote:
>
>> On Thu, 10 Jun 1999, Deamon George Scapin wrote:
>>
>> > I am writing a perl script and need to find a way to get several
>> > dimensions. I need the dimensions of
>> >
>> > 1) An image
>>
>> Use Image::Size from CPAN.
>>
>> > 2) The viewer window
>> > 3) The screen size setting.
>>
>> What viewer? What window? What screen? :-) If you're needing to
>> interrogate a remote device, such as a browser, you should check with the
>> docs, FAQs, and newsgroups about browsers and the protocols used with
>> them.
>>
>
> I have Image::Size. I put
>
> use Image::Size;
>
> but when I try to use it, I get an error that reads:
>
> C:\Program Files\sambar42\cgi-bin>perl image.pl
> Can't locate Image/Size.pm in @INC (@INC contains: C:\PERL\lib\site
> C:\PERL\lib
> c:\perl\lib c:\perl\lib\site c:\perl\lib\site .) at image.pl line 3.
> BEGIN failed--compilation aborted at image.pl line 3.
>
> So that makes me think the program can't find Size.pm because it is trying to
> look in a directory Image for Size.pm. So I change the use statement to
> read.
>
> use Size;
>
> I get the following error:
>
> C:\Program Files\sambar42\cgi-bin>perl image.pl
> Undefined subroutine &main::imgsize called at image.pl line 17.
>
> line 27 of image.pl states the following.
>
> ($x, $y) = imgsize($imageName);
>
It looks like you have failed to install Image::Size correctly - You need
to have the directory c:\perl\lib\site\image containing the files from
the distribution - I am pretty certain there is no PPD file for easy
installation from Activestate and I am also pretty sure there are no
XS componenents to worry about.
> As far as the browser, I am trying to suite the needs for IE and Netscape. I
> will follow your advice and look at the documentation.
> When I am refering to the screen, I am talking about the viewable computer
> screen settings. If the user has 1024 x 768 or 800 x 600, or whatever the
> case may be...
>
None of this can be done in a CGI program - if you need to find out more
you might want to ask in some group in the comp.infosystems.www.* hierarchy.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 14:39:16 -0500
From: "Mike Sanders" <msanders@thetangledweb.net>
Subject: File Locking
Message-Id: <QHd83.48$QP1.482108@news1.i1.net>
I'm stumped on this flocking
I'm trying to use this test
while(!flock(FILEHANDLE,2)){
sleep 1
}
Do Stuff
or used this test
if(flock(FILEHANDLE,2)){
Do Stuff
}
Neither work correctly, I thought that flock() returned true or false.
Either way stuff is getting done without taking turns.
------------------------------
Date: Fri, 11 Jun 1999 15:55:10 -0400
From: Craig Ciquera <craig@mathworks.com>
Subject: Re: File Locking
Message-Id: <3761699E.3309F2C4@mathworks.com>
You can only grab a lock, there is no way to test the lock.
Craig
Mike Sanders wrote:
> I'm stumped on this flocking
>
> I'm trying to use this test
>
> while(!flock(FILEHANDLE,2)){
> sleep 1
> }
> Do Stuff
>
> or used this test
>
> if(flock(FILEHANDLE,2)){
> Do Stuff
> }
>
> Neither work correctly, I thought that flock() returned true or false.
> Either way stuff is getting done without taking turns.
------------------------------
Date: Fri, 11 Jun 1999 14:04:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: File Locking
Message-Id: <MPG.11cb19a6a8949c75989bc4@nntp.hpl.hp.com>
In article <3761699E.3309F2C4@mathworks.com> on Fri, 11 Jun 1999
15:55:10 -0400, Craig Ciquera <craig@mathworks.com> says...
> You can only grab a lock, there is no way to test the lock.
That depends. If the OS supports lockf(2), there is a flag F_TEST 'test
region for lock'. The region can be the entire file.
One could invoke lockf() using syscall with the appropriate arguments.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 11 Jun 1999 20:42:39 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File upload/download Web app.
Message-Id: <7jrsbv$k5$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 16:15:21 +0100 Paul Bunkham wrote:
> Jonathan Stowe wrote:
>>
>> Paul Bunkham <paul.bunkham@synetica.com> wrote:
>> > Why don't people actually help in this newsgroup? Jen here, may have
>> > posted to the wrong place, but that is no reason to not pass on
>> > information if you have it.
>> >
>>
>> I suppose you think we should pass on our recipes for doughnuts as well
>> if someone asks ?
>>
>
> Yes, why not? All the other threads in this group that have got moans
> about the "perl community" and everything being open source, and you
> shouldn't help people if they want to keep their information. Why don't
> you listen to what your saying? If I had been using this group for a
> long time I would no doubt get more upset with the ridiculous number of
> messages posted saying just "And where's your perl question?", than I
> would with reading off topic posts by new users and helping people with
> other knowledge that I can share.
>
OK the job's yours - you can start on Monday: I suppose it would only be
fair to mention that the last person who took it on is in Broadmoor now.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 17:04:02 -0400
From: "Kevin Marlowe" <k.l.marlowe@larc.nasa.gov>
Subject: GIFgraph output to web page
Message-Id: <7jrtl7$h5u$1@reznor.larc.nasa.gov>
I'm trying to use GIFgraph to output directly to a web page (instead of a
file) as a cgi, but keep getting a server error when executing the code. I'm
trying to use the "plot" function in one of the sample plots, just replacing
the "plot_to_gif" function that's in all of the samples. Image file header
problem? Anyway, I think I can figure this out with a clue or two; does
anyone have an example of a working GIFgraph cgi that writes directly to
STDOUT that I could look at?
Thanks - KLM
------------------------------
Date: 11 Jun 1999 21:00:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to read excel file ?
Message-Id: <7jrtd6$kb$1@gellyfish.btinternet.com>
On Thu, 10 Jun 1999 12:10:54 -0700 Gopal Kethineni wrote:
>
> How do I read MS-Excel file in perl for unix and manipulate the
> data and save it in text format?
>
If you go to <http://reference.perl.com> and follow the Win32 link
you will come by a thing called LAOLA which is an attempt to enable
the reading of OLE storage files such as Excel in Unix - I cant vouch
for its utility though ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 19:14:10 GMT
From: fred222@mauimail.com (George)
Subject: HTTP protocol etc.
Message-Id: <fred222-ya023580001106991511480001@news.bellatlantic.net>
I was curious - I'd like to muck about with connecting to servers and
grabbing pages on a bit lower level than LWP seems to let you do, and I was
wondering if anyone could point me towards some documentation or resources
that would be helpful in figuring out what lines to send the server, etc.
and how to approach it.
Thanks for everyone's help, this newsgroup has gotten me through many a
problem! :)
If replies could be cross-emailed to me at the following address without
the NOSPAM, I'd appreciate it.
yurtle@bellatlantic.netNOSPAM
Best regards,
George
--
If you get the joke, you're a geek:
A VW Beetle was seen in california, bearing the license plate: "FEATURE"
------------------------------
Date: Fri, 11 Jun 1999 15:17:22 -0400
From: Craig Ciquera <craig@mathworks.com>
Subject: Re: HTTP protocol etc.
Message-Id: <376160C2.F0CA3736@mathworks.com>
Go to:
http://www.rfc-editor.org/cgi-bin/rfcsearch.pl
and search fot http.
Then read until your hearts desire.
Craig
George wrote:
> I was curious - I'd like to muck about with connecting to servers and
> grabbing pages on a bit lower level than LWP seems to let you do, and I was
> wondering if anyone could point me towards some documentation or resources
> that would be helpful in figuring out what lines to send the server, etc.
> and how to approach it.
>
> Thanks for everyone's help, this newsgroup has gotten me through many a
> problem! :)
>
> If replies could be cross-emailed to me at the following address without
> the NOSPAM, I'd appreciate it.
>
> yurtle@bellatlantic.netNOSPAM
>
> Best regards,
> George
>
> --
> If you get the joke, you're a geek:
> A VW Beetle was seen in california, bearing the license plate: "FEATURE"
------------------------------
Date: Fri, 11 Jun 1999 15:43:06 -0400
From: brian@pm.org (brian d foy)
Subject: Re: HTTP protocol etc.
Message-Id: <brian-ya02408000R1106991543060001@news.panix.com>
In article <fred222-ya023580001106991511480001@news.bellatlantic.net>, fred222@mauimail.com (George) posted:
> I was curious - I'd like to muck about with connecting to servers and
> grabbing pages on a bit lower level than LWP seems to let you do, and I was
> wondering if anyone could point me towards some documentation or resources
> that would be helpful in figuring out what lines to send the server, etc.
> and how to approach it.
there's the CGI Meta FAQ which references everything you need to know.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 11 Jun 1999 19:35:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: I'm really peaved off!
Message-Id: <7jroe1$gl$1@gellyfish.btinternet.com>
On Thu, 10 Jun 1999 17:32:04 +0100 Tobin wrote:
> Hi
>
> I've been working on a program for a while and it has been running on the
> Hypermart web server perfectly for ages.
>
> I recenlty made some modifications and now I get the following error on
> executing the script.
> ---------------------
> Errors:
> [Fri Jun 11 09:23:57 1999] access to /data1/hypermart.net/tobin/data1.pl
> failed for 194.176.215.106, reason: file permissions deny server execution
> exec of /data1/hypermart.net/tobin/data1.pl failed, reason: Exec format
> error (errno = 8)
Check you havent messed up your shebang (#! ) line.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 13:52:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: installing modules
Message-Id: <376176F9.BA6AD61C@mail.cor.epa.gov>
Deamon George Scapin wrote:
>
> I tried to install a module called Image::Size.
>
> I put it in \perl\lin\Image subdirectory and it is pointed to by @inc
Did you do everything listed in perlfaq8? Let's see...
When you built your module, did you use the PREFIX option when
generating the Makefile? Did you get the directory right?
Because a unix path would have forward slashes instead of
backslashes, and a win32 path ought to have a UNC or a drive
letter. If this is a win32 box, you ought to be using
ActiveState's ppm installer anyway.
Okay, then before you run the Perl program, do you set the
PERL5LIB environment variable? If not, then in the program do
use the 'use lib' pragma to incorporate your directory into
@INC ? Note the capital letters, because if you put the
path into @inc [as you said], that's not going to help.
> When I try to use the module and refer to function in it, I get an error.
>
> C:\Program Files\sambar42\cgi-bin>perl image.pl
> Can't locate auto/Image/Size/autosplit.ix in @INC (@INC contains:
> C:\PERL\lib\si
> te C:\PERL\lib c:\perl\lib c:\perl\lib\site c:\perl\lib\site .) at
> C:\PERL\lib/A
> utoLoader.pm line 84.
> at C:\PERL\lib/Image/Size.pm line 211
> Content-Type: text/html
>
> What is this autosplit.ix and why can't it be found anywhere? Is this a file
> that is automatically generated because I found the file in several other
> module subdirectories. Thanks in advance.
Okay, go back to the top and find my note about ActiveState's
ppm program. Use that to install it. At a command prompt,
just type:
ppm install Image-Size
and wait a minute.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 11 Jun 1999 14:20:59 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: Linus Torvalds and Carmen Electra?
Message-Id: <3761538B.C19A9BC9@xli.com>
John Bjorgen wrote:
>
> I apologize...I'm a newbie and didn't realize I was committing such a grave
> error.
> Forgive my impropriety. Just trying to get some attention to get my
> questions
> answered. Will never do it again
>
> John Bjorgen
>
> By the way, what is killfiled?
I wouldn't worry too much, Marcel's recent posts
shows more interest in being hall monitor than
pointing anyone in a helpful direction.
so its not likely you'd ever get some useful information out of him.
I use subject headings to filter out which messages to read/reply to.
since I only use certain aspects of perl, I look for stuff that may
help me, or I might be able to answer. so you are better off
having the subject resemble the qestion in some way, just so that
someone with the answer might spot it and reply.
put the humor in the signature, if you want to add a chuckle.
god knows this group gets pretty serious with netiquette
nazis, and flamefests once ina while, and it can use some
humor.
Greg
"What did you do, wake up this morning, and say to yourself,
Today, I'm going to ruin a man's life?"
- Micheal Douglas, Romancing the Stone
>NAPQ
>(Not A Perl Question)
>
>Ask in an HTML-related newsgroup.
>
> On Fri, 11 Jun 1999 09:46:02 +0200, "Bastiaan S van den Berg"
> <office@asc.nl> wrote:
>
> >hi
> >
> > i need to create a form that has several checkmarks you can click
> That's nice.
>
> > once you click them , a frame or a value in a box should be updated to show
> >the new total
> Lovely.
>
>
> > i want to do this with perl
> You want to do this with JavaScript.
>
>
> >- is there a way to run perl programs on 'changes' in forms?
> >- is there a way to let perl change values in forms?
> >- is there a way to let perl change frames and / or frame contents?
>
> Better ask this in some CGI group.
>
> On Fri, 11 Jun 1999 04:28:22 GMT, R.Joseph
> <streaking_pyro@my-deja.com> wrote:
>
> >Ok, lets say I have a script that takes in user data, and then uses
> >this data to search many different engines (like say, 8 search engines
> >with the field the enter). If I want each search engines results to
> >come up in a new window, how would I accomplish this?? Thanks alot!
>
> 26 minutes later and still NAPQ.
>
> This time it's more of a CGI-related issue. Ask in a CGI group.
------------------------------
Date: Fri, 11 Jun 1999 20:36:16 GMT
From: Jason Eggleston <jason@eggnet.com>
Subject: Re: mod_perl require problem
Message-Id: <7jrrvv$pcd$1@nnrp1.deja.com>
Well, I read the man page on the -X switch and... got scared ;)
I tried your use lib and require suggestions, and it worked! The
script now properly includes files every time and runs perfectly.
Thank you for your help,
-Jason
In article <37611792.43938682@dwc.ch>,
Christoph Wernli <cw@dwc.ch> wrote:
> [posted and mailed]
> It looks like you've run into the "compile once, run multiple times"
pitfall (indicated by
> "works about 1 out of every two tries).
>
> Try this:
>
> - run your httpd with the -X switch (daemon won't fork)
> - replace the BEGIN{}-block with
> use lib '/home/httpd/html/';
> require 'stdinc.pl'
>
> Cheers,
>
> -werns
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 11 Jun 1999 21:43:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NT Perl - .plx work, .pl don't
Message-Id: <7jrvtq$l0$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 11:08:22 -0500 Ron Jones wrote:
> Help!
> Okay, I've got NT IIS 4.0 with SP 4.0. I've just installed Perl build 517
> over my previous build 515 to catch up and solve this problem....it didn't
> solve the problem.
> Perl scripts named .plx work just fine when served from the web server,
> but scripts named .pl are tyring to be downloaded instead of executed. I
> was hoping the fresh install of 517 would fix whatever was wrong...it
> didn't. Is the use of .pl files mutually exclusive of using .plx
> (perlIS.dll)? This should all be automatic, and yes, I did check off the
> boxes for .plx mapping, and .pl file associations. What could be wrong? I
> know when I looked at this before it suggested a mime mapping problem, but
> shouldn't the re-install taken care of that? Help!
There is documentation installed under an Activeperl link in your start
menu - in this there is a document that describes how you can set up
various HTTP servers to work with Perl. If the information that you
need cant be found there you would probably be better of asking in
the group comp.infosystems.www.servers.ms-windows .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 20:42:04 GMT
From: izzac@videotron.ca (IzB.)
Subject: Re: Out of Memory!!!
Message-Id: <3761700b.9617473@news.videotron.ca>
Ok! I'm sorry two more time!!!
nothing are easy for me today...!
use Win32::IProc
# now importing all the constants
qw( SW_SHOWNORMAL SW_SHOWDEFAULT SW_SHOWMAXIMIZED SW_HIDE SW_SHOW
SW_MAXIMIZE FOREGROUND_RED FOREGROUND_GREEN FOREGROUND_BLUE
BACKGROUND_RED BACKGROUND_GREEN BACKGROUND_BLUE FOREGROUND_INTENSITY
NORMAL_PRIORITY_CLASS PROCESS_ALL_ACCESS INHERITED FLOAT DIGITAL NULL
CREATE_NEW_CONSOLE);
my($Title)="Welcome to the world of Perl!";
my($Attributes)=FOREGROUND_RED | BACKGROUND_RED | BACKGROUND_GREEN |
BACKGROUND_BLUE;
my($compteur) = 0;
my(@obj);
for ($c=0;$c<=9;$c++) {
$obj[$c]=new Win32::IProc || die;
$obj[$c]->LastError;
}
$alive=1;
while ($alive) {
$alive=0;
for ($c = 0; $c <= $#obj; $c++) {
$obj[$c]->GetExitCode($obj[$c]->{ProcessHandle},\$ExitCode);
if ((!defined($ExitCode) || $ExitCode !=259) && $compteur < 50000)
{
$obj[0]->Create(NULL,"perl run.pl",INHERITED,CREATE_NO_WINDOW,
".",$Title,SW_SHOWDEFAULT,200,200,300,300,$Attributes);
$compteur++;
$alive=1;
}
else { if ($ExitCode == 259) { $alive=1; $nbalive++; }}
}
print "$compteur process lance sans probleme\n";
}
Ok!
I examined the memory usage with "Idyle Taskmanager98" (for win95) and
I saw that the memory climb always a little bit more...! After 2000
process launched my memory never goes down bottom of 100000K and at
the beginning it always between 80000K and 95000K.
(scuse my english....my french is better!!!:o)
izzac
------------------------------
Date: Fri, 11 Jun 1999 19:49:04 GMT
From: Bill_ThompsonNOSPAM@OneNOSPAMSource.com (Bill Thompson)
Subject: Perl and WinNT services
Message-Id: <3762681d.112790954@proxyftp>
Has anyone successfully written a WinNT service with Perl? Although
I could just install a program using the InstSrv.exe utility, it would
be nice to be able to respond more gracefully to commands to halt
services, pause services, etc.
It seems doable with all of the com object packages and knowing that
you can now build a service with visual basic using similar objects.
------------------------------
Date: Fri, 11 Jun 1999 14:00:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl and WinNT services
Message-Id: <376178D9.D0A200BF@mail.cor.epa.gov>
Bill Thompson wrote:
>
> Has anyone successfully written a WinNT service with Perl? Although
> I could just install a program using the InstSrv.exe utility, it would
> be nice to be able to respond more gracefully to commands to halt
> services, pause services, etc.
You'll be surprised to learn that this has been asked often
enough that it's a FAQ. It's not in the Perl FAQ, but in the
ActivePerl FAQ that comes with every install of ActiveState
Perl.
> It seems doable with all of the com object packages and knowing that
> you can now build a service with visual basic using similar objects.
And now there are modules in Perl that will help a lot with
this too. I've been told you can snag them with nothing more
than ppm. They may not be on the ActiveState site, though.
You may have to go to Dave Roth's site. But the ppm address
for his site is in the ActivePerl docs too.. under the
section on using ppm.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 11 Jun 1999 21:40:22 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl class and constructor
Message-Id: <7jrvo6$kt$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 11:02:33 -0400 Songtao Chen wrote:
> Hi everyone,
>
> The code below (Person.pm) is from the perltoot manpage in Perl 5.004
> package.
>
> According to the manpage, we can do,
>
> use Person;
>
> $him = Person->new();
> $him->name("Jason");
> $him->age(23);
> $him->peers( "Norbert", "Rhys", "Phineas" );
>
> I believe this is the right way to use the class. However,
> since $him is the reference to the hash as returned from the
> constructor,
> we could also do this,
>
> ...
> $him->{'NAME'} = "John";
> $him->{'AGE'} = 32;
> ...
>
> Any comments for this ?
>
Is the use of the blessed thingy that is returned by the constructor
in this way part of the documented interface to the Class ? If it is
not then you have just broken your part of the contract that allows
you certain freedoms in relation to other languages that support OO
but also gives you some responsibilities. Using some knowledge of
the internal workings of Class to violate its interface is the best
way to ensure that your code will break when the storage method
used by the Code is changed by the developer.
> Question: how could I return something other than the
> reference to the anonymous hash and keep
> the object alive ?
>
You have to return a blessed *something* from your constructor and you
could perhaps arrange some other storage method for your classes private
data but I am not quite sure why you want to allow the classes users
access to that data directly.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 16:06:23 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Perl class and constructor
Message-Id: <x3y7lpacxj6.fsf@tigre.matrox.com>
Songtao Chen <@cisco.com> writes:
> use Person;
>
> $him = Person->new();
> $him->name("Jason");
> $him->age(23);
> $him->peers( "Norbert", "Rhys", "Phineas" );
>
> I believe this is the right way to use the class. However,
> since $him is the reference to the hash as returned from the
> constructor,
> we could also do this,
>
> ...
> $him->{'NAME'} = "John";
> $him->{'AGE'} = 32;
> ...
>
> Any comments for this ?
Of course you can do this. But this defeats the whole idea of
object-oriented programming. Unlike a real OO language (like C++),
Perl doesn't have private and public data. You can go ahead and access
object properties, in the same way that you can go ahead and fiddle
with the namespace directly; nothing will prevent you from doing so.
But this is considered bad programming style. Access to object
properties should be through object methods only.
For example, think of what happens if the maintainer of the class
simply had to change the key 'NAME' to 'name' due to some
reason. Being the good programmer that he/she is, he/she also modified
the name() method to work properly and retrieve/set $obj->{'name'}.
Now, if the user of the class is a good programmer and used only the
methods to access/modify the data in the object, he/she will see no
change in the behaviour of his/her program and will require no change
to the code. If, on the other hand, the user had used direct access to
the object's properties, then he/she will have to know that 'NAME' has
been changed to 'name' and will have to go into the code and change
all occurrences of 'NAME' to 'name'. For more complex changes, this
process will not be trivial, and can consume a lot of time.
I repeat, access to object properties should be through object methods
only.
Then again .. I am not that experienced in OO programming :)
> Question: how could I return something other than the
> reference to the anonymous hash and keep
> the object alive ?
Well, if you don't return the hash (which is your object really), then
you will lose it, unless you make it a global variable, which is
really messy less useful. Why would you want to return something else?
But, if you have to return something else, then why don't you return
the object AND whatever else you want to return?
If you give us a good example, someone will show you a good solution.
HTH,
Ala
------------------------------
Date: Fri, 11 Jun 1999 19:00:46 GMT
From: mark_f_edwards@my-deja.com
Subject: perl oracle speed question
Message-Id: <7jrmcq$nbk$1@nnrp1.deja.com>
hello all...
i am trying to extract data from oracle using a parameter...
when i do: SELECT DUMMY FROM DUAL WHERE DUMMY = :1
and say i do an: &ora_bind($csr,$param_value);
i notice that $param_value MUST be set BEFORE i execute ora_bind,
and ora_bind must be "re-set" every time, and that is VERY slow!!
anybody have any thoughts on how i might speed this up???
thank you very much,
mark.edwards@sunh.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 14:43:51 -0700
From: "J|rgen Exner" <juex@my-dejanews.com>
Subject: Perl Parser for JavaScript and VBScript wanted
Message-Id: <7jrvu8$5fb@news.dns.microsoft.com>
I know there are two parsers for HTML available on CPAN.
However they don't support Java/VB Scripting which is essential if you want
to analyse DHTML pages.
Did I just missed the Java/VB script parser or did nobody bothered to write
one yet?
jue
--
J|rgen Exner
------------------------------
Date: 11 Jun 1999 20:11:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Please Help!!
Message-Id: <7jrqi4$ij$1@gellyfish.btinternet.com>
On Fri, 11 Jun 1999 15:25:30 GMT jrknoll wrote:
>
<snip good advice for the neophyte>
> Just for reference I have violated #2,#4,#6
> and was not treated very kindly for it- but it was my own damn fault.
>
Hey and you're still alive - Wanna join the Perl Spartacists with Tad &
Myself - our motto is "Whatever doesnt kill a newbie makes him stronger"
;-}
> Share what you know. Learn what you don't.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Jun 1999 20:25:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Require "No NT commands" on UNIX
Message-Id: <7jrrbo$in$1@gellyfish.btinternet.com>
On Thu, 10 Jun 1999 16:04:21 -0800 Ashish Kadakia wrote:
> Currently I cannot run web server on that UNIX machine,
> also the perticular command that I am looking for
> is "gunzip". In future, I may look for some other commands.
> language.perl.com/ppt doesn't have gunzip.
You can get gunzip for MS platforms - infact you can get damn near any
of the gnu tools that you can think of - try <http://www.delorie.com>
for the djgpp ports of these things although there are others ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 11 Jun 1999 12:50:12 -0700
From: mikej <mikej@1185design.com>
Subject: setting group ownership of a directory from perl
Message-Id: <37616872.ACD50567@1185design.com>
Hi,
I am trying to change the group ownership of a directory I made with one
of my perl scripts (under UNIX), but its just not working. Everytime I
create a new directory it makes it as group = nobody, when I want it to
be be group = www. Can someone help me out? This is what I have:
#make a directory one level up from the script called whatever
$clientname is
mkdir ("../".$clientname, 0777) || &error("Couldnt create the
directory.......");
#the above part works fine and makes the directory
#then the script goes on to create more directories and files under this
directory, with no problems, until we get to this line......
#change group ownership of directory structure from nobody to www
print `chgrp -R www ../$clientname/`;
When I go back and manually type the chgrp line from the shell, it will
work, but it doesnt seem to work from my script. Any ideas?
-mike
------------------------------
Date: Fri, 11 Jun 1999 16:37:34 -0400
From: brian@pm.org (brian d foy)
Subject: Re: setting group ownership of a directory from perl
Message-Id: <brian-ya02408000R1106991637340001@news.panix.com>
In article <37616872.ACD50567@1185design.com>, mikej <mikej@1185design.com> posted:
> I am trying to change the group ownership of a directory I made with one
> of my perl scripts (under UNIX), but its just not working. Everytime I
> create a new directory it makes it as group = nobody, when I want it to
> be be group = www. Can someone help me out?
use chown(). see the perlfunc manpage for details. you might need
special privileges for this though.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: Fri, 11 Jun 1999 20:39:13 GMT
From: gsherman2773@my-deja.com
Subject: Re: Verifying date data
Message-Id: <7jrs5f$pdt$1@nnrp1.deja.com>
Hold on here a second. I'm not sure that telling
somebody about Date::Manip, Date::Calc, etc. is
adequately dealing with the problem of verifying
that a date string is indeed a valid date. Great
as those modules are, I haven't yet seen a
function akin to the ' isdate($datestr) returns
bool ' function I've seen in the Windows/Basic
world. I really need such a function to validate
dates coming across in CGIs, and I wonder how
others have solved this problem. I'm sure MANY
people have had to deal with this problem, but I
see nothing in the FAQ, etc. about it. If
somebody has a one-liner of code that takes care
of this issue, you'd be helping me (and perhaps
others) out a lot.
A solution I've come up with is convoluted in its
implementation, but I hoping will work well
enough:
(in pseudocode)
$bogusdatestr gets changed to a $systemdate (using
HTTP::Date's str2time() function);
$systemdate gets changed back to a $newdatestr
(using the time2str() function)
a comparison between the $bogusdatestr and
$newdatestr strings should indicate if the date is
valid.
There's gotta be a better way to do this,
especially if the Perl's gonna live up to its
terse, sparse code image. Hey, if somebody's got
a similar line of code for NetScape's JavaScript
language, I'd also love to see it!
Thanks,
G. Sherman
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 19:21:05 GMT
From: dwang999@my-deja.com
Subject: Which .gz file to download for Net::Cmd.pm ?
Message-Id: <7jrniq$nnd$1@nnrp1.deja.com>
I try to download the Net::Cmd.pm from CPAN but could not find which
.tar.gz file to download. Any help is appreciated.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 11 Jun 1999 21:14:26 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Which .gz file to download for Net::Cmd.pm ?
Message-Id: <slrn7m2v7q.20c.fl_aggie@thepentagon.com>
On Fri, 11 Jun 1999 19:21:05 GMT, dwang999@my-deja.com
<dwang999@my-deja.com>, in <7jrniq$nnd$1@nnrp1.deja.com> wrote:
+ I try to download the Net::Cmd.pm from CPAN but could not find which
+ .tar.gz file to download. Any help is appreciated.
I was about to guess[*]. But I realized that I could be lazy and accurate.
If you don't have the CPAN module installed, get it. Install it. Use
it.
% perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.50)
ReadLine support enabled
cpan> i /Net::Cmd/
[blahblahblah]
CPAN_VERSION 2.12
CPAN_FILE GBARR/libnet-1.0606.tar.gz
[blahblahblah]
Answer: it's in libnet...
James
[*] libnet was my guess...
------------------------------
Date: Fri, 11 Jun 1999 19:46:04 GMT
From: dwang999@my-deja.com
Subject: which .tar.gz file contains Net::Cmd.pm?
Message-Id: <7jrp1p$o7l$1@nnrp1.deja.com>
Which .tar.gz file contains the Net::Cmd.pm module?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
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 5965
**************************************