[12521] in Perl-Users-Digest
Perl-Users Digest, Issue: 6121 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 24 20:07:21 1999
Date: Thu, 24 Jun 99 17:00:19 -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, 24 Jun 1999 Volume: 8 Number: 6121
Today's topics:
Re: _Please_ improve localtime! <keithmur@mindspring.com>
Re: ActiveState PERL and COM problems <cassell@mail.cor.epa.gov>
Re: ActiveState PERL and COM problems (Jan Dubois)
Re: Can not write my file to the server (Ben Coleman)
CGI.pm, hashes, passing by reference and two different <john.warner@tivoli.com>
Re: Creating graphics on the fly for web pages boris_bass@my-deja.com
Dynamic Page Generation <lcoates@bu.edu>
Error in my CGI that a can't find! Need help debugging (Wayne Venables)
Re: faqs, beginner question <cassell@mail.cor.epa.gov>
Re: garbage collector (Andrew Allen)
Re: getting rid of a character <cassell@mail.cor.epa.gov>
Re: Intelligent case conversion? (eg., Title Case) (Lee Borkman)
Re: localtime (perldoc -f localtime didn't help) (Andrew Allen)
Re: Network admin <cassell@mail.cor.epa.gov>
Re: Perl Compiling, executables, and integration with C (Cory C. Albrecht)
Regex question (i think) <Gened@ohinter.net>
Re: Send e-mail using Perl?? <tchrist@mox.perl.com>
Re: Server Running Perl - Resources? <webmaster@chatbase.com>
Strange error with form variable and filename <kenny@weng.dk>
Re: validating a regexp from a CGI form (Andrew Allen)
Re: Viral matters [completely off-topic] <bill@fccj.org>
Re: What in my concatenated string? <aef@pangea.ca>
Re: Wraparound Array/list... <tchrist@mox.perl.com>
Re: XS question: problem with adv. perl example kellan1@my-deja.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Jun 1999 17:27:13 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: _Please_ improve localtime!
Message-Id: <3772B0C0.A6E7D27C@mindspring.com>
Russell Schulz wrote:
>
> zenin@bawdycaste.org writes:
>
> > If you want human grokable output, use a tool designed for it.
> > localtime() isn't that tool and any "realtime()" kluges would
> > be little more then redundant.
>
> But that `little' is significant -- it would remove the ease with
> which Perl is used to create Y2K problems.
>
> Nobody is confused by `1999' turning into `2000', yet so many people
> have posted about `99' turning into `100' (and so many more have
> written code that will fail). Imagine if the more useful interface
> became the standard and the more ridiculous interface became deprecated.
>
> That's a `little' I think is worth taking a little effort to get.
Two scenarios:
(1) If you change the results of localtime(), and don't change the name,
well-written code starts breaking. Not only that, you don't get the
"beneficial" effects of the change until someone changes the Perl
version.
(2) If you create an interface with a different name, folks have to know
about it and take the effort to change their code to use it. If that's
the case, it would be just as easy for them to change their code to
accomodate localtime() in a correct fashion.
The only folks you'd be helping are the ones that start coding date
routines when the new interface comes out. And they're not really the
problem; it's all that screwed-up code that is already written and will
break in the year 2000 or before. In other words, at this late date,
how many months worth of bad code would this avoid? Especially
considering that many of the ones using this new function would probably
be aware enough (I mean, they heard about it, and they or their sysadmin
updated Perl) to use localtime() properly.
Have I missed something here, Russell?
-----------------
Out, damned spot!
Out, spot, out!
-- Shakespeare for First Grade
------------------------------
Date: Thu, 24 Jun 1999 15:19:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Kevin Hill <kevin.hill@tab.co.nz>
Subject: Re: ActiveState PERL and COM problems
Message-Id: <3772AF08.E051C6AE@mail.cor.epa.gov>
[courtesy cc sent to poster]
Kevin Hill wrote:
>
> I can't get ActivePerl to handle IDispatch interfaces the way they are
> documented. The examples for Excel make sense, but I can't get my
> objects to return other objects like they do (e.g.
> $excelObj->Workbooks->Add).
> [SNIP]
Since you haven't gotten an answer in the newsgroup, I thought
I would tell you that Win32-centric issues are more likely
to get assistance on the perl-win32-users listserv, to which
you can subscribe by going to
http://www.activestate.com/support/mailing_lists.htm
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 25 Jun 1999 00:32:22 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: ActiveState PERL and COM problems
Message-Id: <3779af95.19718744@news3.ibm.net>
[mailed & posted]
Kevin Hill <kevin.hill@tab.co.nz> wrote:
>I can't get ActivePerl to handle IDispatch interfaces the way they are
>documented. The examples for Excel make sense, but I can't get my
>objects to return other objects like they do (e.g.
>$excelObj->Workbooks->Add).
>
>For example let's say an object called MyApplication exposes an
>IDispatch interface. Within that interface is a property "TheQueue"
>which is another IDispatch interface to a Queue object.
>
># I create an instance of MyApplication:
>$app = Win32::OLE->new('Test.MyApplication');
># now create an instance of a queue
>$queue = Win32::OLE->new('Test.Queue');
>
># this line fails with "Member not found"
>$app->{TheQueue} = $queue;
># however this line fails with "Type mismatch"... go figure
>$app->{TheQueue} = 7;
What you are trying here is equivalent to:
Set app.TheQueue = queue
You might probably want assignment by value and not by reference. This
will be added in the next version of Win32::OLE. You can try it out by
adding the following function to the file \Perl\site\lib\Win32\OLE\lite.pm
directly in front of the SetProperty method:
sub LetProperty {
my ($self,$method,@args) = @_;
$self->Dispatch([DISPATCH_PROPERTYPUT, $method], my $retval, @args);
return $retval;
}
The you can try in your program this:
$app->LetProperty('TheQueue', $queue);
and see if that works. Let me know what you find out.
>Equally I can't return any IDispatch-based object from within another
>one. Why not?
I don't understand this. Could you elaborate?
-Jan
------------------------------
Date: Thu, 24 Jun 1999 22:11:00 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: Can not write my file to the server
Message-Id: <3772ac5c.245254236@news.mindspring.com>
On Thu, 24 Jun 1999 16:14:42 GMT, "Jim Ray" <jim.ray@west.boeing.com>
wrote:
>I am converting my UNIX perl scripts over to NT and I am having some
>problems.
My Condolences.
>Right now the following code will create a file on the server. Under UNIX,
>no problem, under NT big problem.
>
>Here's the code...
>
> open(DATA, ">>$dataname");
<snip>
>NT will not create the file. I am running under IIS4 and have made sure the
>everyone account allows writing the file and also that the NT rights for
>every is set to FULL.
>
>Still the file does not get created. I am I missing something here?
Does $dataname have the full pathname for the file? If not, maybe you
should check on what the current directory is when IIS4 runs a CGI program.
It's likely it's not the directory your script is in.
Ben
--
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA
------------------------------
Date: Thu, 24 Jun 1999 15:53:24 -0500
From: John Warner <john.warner@tivoli.com>
Subject: CGI.pm, hashes, passing by reference and two different results?
Message-Id: <37729AC4.8CE18B06@tivoli.com>
I have this script that is driving me nuts. Given an input file with
the following data:
[Perl Tutorials]
url1 = www.perl.com
url2 = www.perl.org
url3 = www.ActiveState.com
url4 = www.cpan.org
[Search Sites]
url1 = www.yahoo.com
url2 = www.lycos.com
url3 = www.deja.com
[SNMP]
url1 = http://www.inforamp.net/~kjvallil/t/snmp.html
ftp.internic.net
and using the following code:
#!/usr/local/bin/perl -w
#use strict; #Use for debugging -- turned off because strings can't be
used for hash indexes with it on.
use CGI qw/:standard :html3/;
use CGI::Carp 'fatalsToBrowser';
my $TopicCount = 0;
my %mylinks;
&print_header;
&getLinks(\%mylinks);
print p("Calling sub printLinks...");
&printLinks(\%mylinks);
print p('Returned from sub printLinks...');
print end_html;
exit 0;
#=============================================================
sub print_header{
print header,
start_html('Learning Central'),
h1('References & Tutorials');
}
#=============================================================
sub printLinks{
my ($m) = @_;
my ($topic,$item);
my @list = ();
print "\n\n",%{$m}->{SNMP},"\n\n";
print p("Entering topic foreach loop");
foreach $topic (keys %{$m}){
my $t = %{$m}->{$topic};
@list=();
# print $t,"\n";
print p($t);
print p("Entering link for loop");
for $item (@{%{$m}->{$topic}->{URLs}}){
# print "\t",$item,"\n";
push @list, $item;
}
print ul(li(\@list));
}
print p("Leaving sub printLinks");
}
#=============================================================
sub getLinks{
my ($m) = @_;
my $urlcount = 0;
my ($topic,$t);
open URLFILE, "links.txt";
while (<URLFILE>){
chomp;
# print "DEBUG:getLinks: File input= $_ \n";
if (/^#/) {next;}
if (/^\[(.*)\]/) {
$TopicCount++;
$urlcount = 0;
$t = $topic = $1;
%{$m}->{$t}=$topic;
# print "DEBUG:getLinks: Topic = $topic\n";
next;
}
if (/^url/){
my($t,$url) = split /^url.+\s*=\s*(.*)/;
%{$m}->{$topic}->{URLs}[$urlcount]= $url;
# print "DEBUG:getLinks: Topic URL =
%{$m}->{$topic}->{URLs}[$urlcount]\n";
$urlcount++;
next;
}
}
close URLFILE;
# print "DEBUG:getLinks: Number of link topics = $TopicCount\n";
}
why do I get different results from the command line than I do from the
browser? From the command line, I get the exact HTML I wanted. My
browsers (Netscape 4.51 and IE 5) only display the header information.
Nothing from inside the foreach loop in sub printLinks is sent to the
browser.
It has been suggested to me that using global variables in subroutines
wasn't too cool so I rewrote my code to pass the hash (still global) by
reference to no avail. Am I missing something from the documentation?
I've read perlref, the Perl Cookbook, the Official Guide to Programming
with CGI.pm, and the CGI.pm documentation that comes with ActiveState
and I still have no clue why this is happening. Any help will be
appreciated.
Setup info: NT Workstation 4 sp 4, IIS 4 with perlis.dll, ActiveState
5.005_03 build 517 (CGI.pm 2.46)
Thanks in advance!
John
--
John Warner Tivoli Systems Inc.
Sales Support Engineer 9442 Capital Of Texas Hwy North
Sales Infrastructure Group Austin, TX 78759
john_warner@tivoli.com
------------------------------
Date: Thu, 24 Jun 1999 22:10:00 GMT
From: boris_bass@my-deja.com
Subject: Re: Creating graphics on the fly for web pages
Message-Id: <7kuabg$ind$1@nnrp1.deja.com>
What about GD library? Can anyone point me to good
documentation/examlpes site?
thanx, Boris
In article <7ku6ei$h8h$1@nnrp1.deja.com>,
Kazuma <kazuma@my-deja.com> wrote:
>
> > If anyone has a fix that isn't too cumbersome, I would be very
> > appreciative. I think my last resort is to run a cron job on the
> > server which deletes all of the gif files in the temp directory.
>
> One possible solution is not to save the image on the disk, but
> generating the images on the fly on the web:
>
> <IMG SRC="/cgi-bin/generateImage.pl?<PARAMETERS>">
>
> Something similar (can be achieved with an SSI.
>
> Best Regards,
> Kazuma
>
> --
> Cos'e' il genio: fantasia, intuizione,
> colpo d'occhio e velocita' d'esecuzione...
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 24 Jun 1999 19:06:28 -0400
From: "Laran Coates" <lcoates@bu.edu>
Subject: Dynamic Page Generation
Message-Id: <7kudm3$flf$1@ash.prod.itd.earthlink.net>
I'm writing a script to take fields from a form and populate and display
another html page using those values. I would ultimately like to have the
script email the new document to an email address specified by the user.
Has anyone got any good ideas.
I know that this is basically the most common of all perl scripts but I'm
new to the language and have been stuck now for a few days on this.
The matter is somewhat pressing so any and all help would be appreciated. \
Thanks.
Sincerely,
--
Laran Coates
lcoates@interactioninc.com
781.246.1545
Webmaster
Interaction Inc.
27 Water St. Wuite 405
Wakefield, MA
01880
------------------------------
Date: Thu, 24 Jun 1999 22:33:22 GMT
From: wvenable_net@iname.com (Wayne Venables)
Subject: Error in my CGI that a can't find! Need help debugging!
Message-Id: <3772afbd.13991535@news.sprint.ca>
Hello Everyone,
I'm developing a complex CGI application in Perl. My development
machine is Win32 with ActiveState Perl (lastest version) and my target
is presently some unknown Unix box to which I don't have shell access.
All was fine and good, until I made some changes: Now it works finally
locally on my Win32 box, but fails on the server!
I believe I've tracked the problem to a specific module that I
wrote and that I'm importing.
I've included the following in the code of each module:
use mgr_debug;
$SIG{__WARN__} = \&mgr_debug::warn;
$SIG{__DIE__} = \&mgr_debug::dead;
And I've used it to sucessfully track runtime errors on the server.
The warn/dead functions, simply spit the error to stdout with a
Content-Type header so I can see any runtime errors in the browser
when I execute the CGI.
But the script fails, I get no output! It seems to me the script is
probably failing at compile-time while importing a particular module.
How can trap the errors and write them to stdout or to a file so I can
find out what the problem is?!?
(Keep in mind, I have no access to the server whatsoever except to
upload files!)
------------------------------
Date: Thu, 24 Jun 1999 15:40:03 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: faqs, beginner question
Message-Id: <3772B3C3.C7293C7F@mail.cor.epa.gov>
Alan Tod Gillespie wrote:
>
> i'm brand new to perl. upon reading the general introductory faqs, i
He read the FAQs! HE READ THE FAQS!!!! YIPPEEE!!
Congratulations, Alan. You're the first person all day to
admit to reading the FAQ. You deserve extra bonus help, even
if you put 'beginner' in your subject line.
> noticed that the relationship between perl, c, and unix is not outwardly
> defined. it seems to me from reading that perl is an extension of c,
> but i would like to understand the relationship better. can anyone
> help?
Well, you'd be better off if Randal or Tom answered you, but
you're stuck with me for now. :-)
Perl is the 'Cliff Notes' of unix. The features that make unix
so different from other OSes, like fork() & exec(), Berkeley
sockets, etc. are intrinsic to Perl. Also, Perl has many of
the system calls embedded in it [e.g., flock(2), getgrgid(3),
and getservbyport(3)].
Perl also has the C operators, with the same precedence,
although it has extended the capabilities of some operators
[try doing **= in C] and added others [like and, or, ...].
And C features like the for loop are in Perl too.
These two aspects together make Perl look very C-ish. But
Perl has lots of non-C features too, which really make
C and C++ programmers wonder what the heck is going on.
Look in perltrap for a list of conditions where C is different
from Perl.
Perl is also the child of Awk [well, if Kernighan spells it
like this, I'm not going to disagree]. Awk and C have some
major syntax disagreements, and some of this rubs off on
Perl. [Does this sound like the problems you hit in
multiple inheritance to you? :-]
And then there's the stuff inherited from sed. And the OO
looks to me more like Python than anything else. It certainly
is *not* C++ .
In fact, Perl has snitched good things from a slew of different
programming languages and tools. I find this to be a good thing.
People who live and die by programming orthogonality consider
this evil, but they don't do real work in those ivory towers. :-)
There was a thread in this NG on the origins of Perl features.
I think it was last winter or fall. You can go to deja.com
and search for it.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Jun 1999 23:39:23 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: garbage collector
Message-Id: <7kufjb$q1t$2@fcnews.fc.hp.com>
Bart Lateur (bart.lateur@skynet.be) wrote:
: vijoc@my-deja.com wrote:
: >Is the perl garbage collector going to change
: > anytime soon?
: I've never had any problems with it so far. Circular references are
: RARE.
>From what I understand, they are very common in perl/Tk (i.e. parent
widgets store their children, child widgets store their parents, etc.)
Andrew
------------------------------
Date: Thu, 24 Jun 1999 15:04:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: getting rid of a character
Message-Id: <3772AB51.A9FADBC6@mail.cor.epa.gov>
Maan Bsat wrote:
> I'm accessing data from a database server, and it's returning times with
> an initial space. How can I get rid of it (I know it's the first
> character in the string).
Well, you could read the FAQ and see the answer there, which
tells how to get rid of arbitrary amounts of whitespace at the
front of your string.
But if you're sure that you have exactly one space every time,
you could just use substr() to cut that space off the front
of the string. That should be faster than using the regex
solution in the FAQ answer.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 22:54:06 GMT
From: borkman@usa.net (Lee Borkman)
Subject: Re: Intelligent case conversion? (eg., Title Case)
Message-Id: <3772b6c5.78920992@news>
Many thanks, that seems perfect. I look forward to studying this for
a month to see what's going on.
Gratefully yours,
Lee Borkman
On Thu, 24 Jun 1999 13:34:00 GMT, Gareth Rees
<garethr@cre.canon.co.uk> wrote:
>Lee Borkman <borkman@usa.net> wrote:
>> I would like something like this:
>>
>> $line = tcase($line, @exclusions);
>>
>> ...to supply my own list of words that shouldn't be capitalized
>> (except at the start of a sentence).
>
>It's probably better to use a hash instead of a list of excluded words
>since the primary operation will be looking up the word in the list.
>
>Here's an implementation:
>
> # title_case($text, $hashref) title-cases $text, except for words
> # that are keys in $hashref. $hashref may be omitted, in which
> # case a default list of words is used.
>
> my %default_exclusions;
> @default_exclusions{qw(a an and for in of or the to)} = ();
>
> sub title_case {
> my @text = split /(\s+)/, lc shift;
> my $x = shift || \%default_exclusions;
> join '', ucfirst shift @text,
> map { exists $x->{$_} ? $_ : ucfirst } @text;
> }
>
>--
>Gareth Rees
------------------------------
Date: 24 Jun 1999 23:49:24 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: localtime (perldoc -f localtime didn't help)
Message-Id: <7kug64$q1t$4@fcnews.fc.hp.com>
[posted and mailed]
Arcane (arcane@verinet.com) wrote:
: Dale Henderson wrote:
: > >>>>> "Arcane" == Arcane <arcane@verinet.com> writes:
: >
: > Arcane> I have the following perl program that when run on the
: > Arcane> commandline it returns the correct time, but once it is
: > Arcane> run through apache the time is an hour behind. This only
: > Arcane> happens on one of my computers and not the other two. I
: > Arcane> would guess it's some kind of TZ setting or daylight
: > Arcane> savings setting, but I don't know where it would be
: > Arcane> located at.
: >
: > Try using gmtime and see if the time-lapse still occurs. Or try
: > print scalar (localtime()) which will print the timezone.
: Using gmtime shows the correct time in both areas. print scalar
: (localtime()) doesn't return the timezone, but doing print `date` does.
: Here is the output of the updated program:
My guess is that the web server didn't properly set TZ. Or that you're
on HP-UX, and /usr/lib/tztab isn't accessible from your CGI program's
environment.
Andrew
------------------------------
Date: Thu, 24 Jun 1999 15:17:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: Giovanni Davila <gio98dr@yahoo.com>
Subject: Re: Network admin
Message-Id: <3772AE75.24F93160@mail.cor.epa.gov>
[courtesy cc sent to poster]
Giovanni Davila wrote:
>
> How can I retrieve information from my domain members? I need to find out
> Service Pack #, CPU type, RAM, Server description.
> I'm using NT Resource kit tools like SrvInfo and WinMSDP.
> Please help!!
Since you still haven't received an answer on the newsgroup, I
thought I would step in. It sounds like what you want are the
kinds of modules that Dave Roth has written, like
Win32::AdminMisc . His website is www.roth.net .
In addition, you might want to get a copy of the O'Reilly
octopus book, Win NT Administration, which is almost all
Perl programming to to NT admin.
Furthermore, you'll want to search the win32-perl-users listserv
archives at ActiveState to find tons of threads on NT admin
issues. I believe that a wide variety of Win32::* modules have
been used to glean such pieces, and you'll find a lot of code
there (as well as on the win32-perl-users listserv, which you
can subscribe to by going to
http://www.activestate.com/support/mailing_lists.htm ).
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 24 Jun 1999 23:12:19 GMT
From: coryalbrecht@hotmail.com (Cory C. Albrecht)
Subject: Re: Perl Compiling, executables, and integration with C/C++
Message-Id: <7kue0j$u0e0_004@news.sentex.ca>
In article <0rPYdb600UiB02CoU0@andrew.cmu.edu>, Jonathan J Mayes <mayes+@andrew.cmu.edu> wrote:
>Hi,
>perl executables,etc. I'm having a hard time finding anything in the
>FAQ's or the general web dealing with these topics. Also equally
>evasive or any articles on C/C++/Perl integration. Can anyone point out
>a good site or sites to visit to aid my search?
The pod files in the perl source distribution have a file called
perlembed.pod. My ISP (running *BSD) has the pod files in
/usr/local/lib/perl5/5.00502/pod, and on my home machine (NT4) at
C:\Perl\lib\Pod. Installation also has the option to convert *.pod files
in to HTML.
--
Cory C. Albrecht
http://www.sentex.ca/~cory/
------------------------------
Date: Thu, 24 Jun 1999 19:06:56 -0400
From: Gene Dolgin <Gened@ohinter.net>
Subject: Regex question (i think)
Message-Id: <3772BA10.8CC4C365@ohinter.net>
How can i use regex to extract an email from a $string? Ive been trying
for a while now and i can't get the entire email address. Its not for a
spammer. Its for an email list converter (im switching mailing services
and need to transfer the list)
-gene
------------------------------
Date: 24 Jun 1999 16:46:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Send e-mail using Perl??
Message-Id: <3772b54d@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
"Robert Leonard" <stuntman@koan.com> writes:
:I would like to write a perl script that would allow me to send an e-mail at
:scheduled times using Activate's Perl for Windows...
Henry Spencer once remarked, "Those who do not understand Unix are
condemned to reinvent it, poorly." We see this every day here as
Prisoners of Bill seek to teach pigs to sing and to use Perl as a
giant hammer to do every possible missing thing that should have come
with the system. The best answer to your question to use the "at"
program or the "cron" program in conjunction with the "mail" program.
The worst answer is to write them all from scratch on your own.
--tom
--
``Lazy people never bother to actually read the manual. Instead,
they (like kids) pick something with big, colorful buttons.''
--Eugene Tyurin <gene@insti.physics.sunysb.edu>
------------------------------
Date: Thu, 24 Jun 1999 16:58:52 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: Server Running Perl - Resources?
Message-Id: <3772C63C.C10F9B5E@chatbase.com>
Troy Knight wrote:
<SNIP>
> > > This isn't the best place to ask about servers but I guess your all
> pretty
> > > knowledgable about servers seeing as most people set them up when they
> > > program in perl.
> >
> > I would guess most don't. You should read through more of the posts
> > here. :-)
> >
> > > What kind of a system would be needed to run a server online for one
> large
> > > website which uses up alot of cgi resources.
> >
> > I don't know, how well can you write a CGI script? Can you write them
> > efficiently? Or do you write slow, buggy programs? Do you plan to make
> > the same mistake as a lot of other sites and use free CGI scripts?
> >
>
> --If I can program in perl why would I need to use free scripts?
You never made mention of the fact that you could program. My point was,
that it makes a big difference. If someone doesn't know how to code
efficiently, then you'll need a faster server or a better programmer.
> > > A pop, smtp, nntp server would
> > > also be running on the same machine with a couple of hundred users.
> >
> > A couple of hundred users at once? A couple of hundred users at once
> > hitting those CGI scripts? Relaying huge emails? downloading 100's of NG
> > posts per minute?
> >
>
> --Couple of hundred users/accounts, as I said
And again, I asked how many people would be accessing it at once (A good
estimate or peek estimate) and what they'll be doing. This *does* matter
a lot as well.. Not just the number.
> > > The site
> > > would be getting about 5000 visitors a day.
> >
> > Visitors or hits? What will they be doing? Is this on top of the 100
> > other users?
> >
>
> --5000 visitors, as it says
Right, and yet again, again, I asked that those 5,000 visitors will be
doing. Will they be calling CGI scripts, or will 95% or more be making
simply httpd requests for web pages? I.e., "how many will be accessing
the CGI scripts?". If very few are, then it calls for less system
resources.
> > > I have a p166mmx with 64meg of
> > > ram and an average speed hd.
> >
> > What OS? What web server? What sort of connection?
What OS, what sort of connection? Just kidding, I'm trying to explain
why I stated those things. :-)
> > > Any ideas then anyone on whether this could cope with all that load?
> >
> > I don't know, how well can *you* set up, maintain and run a web server?
> > How well can you code CGI scripts? Are you going to do this yourself or
> > hire someone to set it up? Why don't you ask the person you plan to hire
> > to set it up, of what would work? Do you have someone to set this up for
> > you? It sounds to me like you need someone to set it up... Want to hire
> > me? You can tell me everything you want to do, plan to do, etc. and I'll
> > tell you what you need, and I'll set it up for you.
> >
>
> --I've seen better ads!
It was a joke - not an ad. I wouldn't feel comfortable getting a job
that way.
> > You'd be better off asking this in another NG, something more geared
> > towards web servers.
>
> --Okay, fair enough.
Cool, you got the point. :-)
<SNIP>
--
Regards,
Tim Greer : webmaster@chatbase.com | software@linkworm.com
The ChatBase: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripts in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, +Sciences.
------------------------------
Date: Fri, 25 Jun 1999 00:03:59 +0200
From: "Kenny Weng" <kenny@weng.dk>
Subject: Strange error with form variable and filename
Message-Id: <7ku9u3$r3i$1@miri.tele.dk>
When I use a filename passed from a form variable the
script dos NOT write og create this file.
I have tried everything but I cant seem to get it to work.
- I have tested with writing the form variable to a temp file: the
string is OK
- I have tested with a preset variable instead: this works
I am using Red Hat 5.2 distribution. Apache is running as nobody. Have tried
Suid-scripts. No luck.
Whats wrong??????
Please respond - maybe its simple
Kenny
------------------------------
Date: 24 Jun 1999 23:46:45 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: validating a regexp from a CGI form
Message-Id: <7kug15$q1t$3@fcnews.fc.hp.com>
Bart Lateur (bart.lateur@skynet.be) wrote:
: jhefferon@my-deja.com wrote:
: > "$dirname/$fn" =~ /$searchstring/
: >for each directory, file pair. I see in the error_log that a lot of
: >users are trying regexp's like "*.txt", which of course bombs the above
: >line and they get a terminated return page.
: Try eval(). Actually, try something like:
: $sub = eval "sub { /$regexp/ }";
: If $sub is undefined afterwards, it failed.
And what's $@, chopped liver?
: You can test each line by doing
: if($sub->();) { ... }
Your sub call is crying. Probably because it has an extraneous
semicolon.
Andrew
------------------------------
Date: Thu, 24 Jun 1999 09:23:29 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Viral matters [completely off-topic]
Message-Id: <377230e0.0@usenet.fccj.cc.fl.us>
>> Who's he/she/it?
Bliss affects ELF Linux files currently; as ELF becomes more
popular, Bliss can migrate with the ELF specification.
http://search.excite.com/search.gw?search=Bliss+virus
-Sneex- :]
FCCJ Data Security Group
______________________________________________________________________
Bill Jones Data Security Specialist http://www.fccj.org/cgi/mail?dss
------------------------------
Date: Thu, 24 Jun 1999 18:07:59 -0500
From: "AEF" <aef@pangea.ca>
Subject: Re: What in my concatenated string?
Message-Id: <7kudq4$55p$1@pumpkin.pangea.ca>
>Rick Delaney replied...[snip stuff]
Thanks for the reply Rick:
if (&GetCookies('topics') ) {
@topics = split (/,/,$Cookies{'topics'} );
for(@topics) {
print "topic: $_ \n";
#didn't actually use the print, other than to find the indicate the error
$string .= ",$_";
# this is to repeat the mistake I indicated in the original posting
}
$string .= ",$newtopic";
&SendCookies ('topics', $string);
}
> >
> > #prints
> > topic:
> > topic:
> > topic:
> > topic: 30
#etc, you get an extra "," for every entry.
> It's "". You showed us all the stuff that you did to get around it but
> none of the stuff that caused your confusion. Substituted in a regex?
>
After some frustration, trying to remove the error commas and empty value,
I though I might try " " as a possibility.
s/^\s+//g;
s/\s+$//g;
and tried:
unless ($_ eq "") { print "$_"}
amongst other things.
Since it has no value I figured "undef", and tried that, too.
------------------------------
Date: 24 Jun 1999 16:02:23 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Wraparound Array/list...
Message-Id: <3772aaef@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
:Just for the hell of it (kids, don't try this with too old Perl,
:5.005_03 is modern enough) (yes, the PUSH method could be optimized):
Yes, there's one or two of these in PCB as well. But
mjd pointed out that a simple $elt++ % $SIZE would be
more efficient.
--tom
--
"There is no reason for any individual to have a computer in their
home." (Ken Olson, President, Digital Equipment, 1977)
------------------------------
Date: Thu, 24 Jun 1999 23:25:13 GMT
From: kellan1@my-deja.com
Subject: Re: XS question: problem with adv. perl example
Message-Id: <7kueof$kb5$1@nnrp1.deja.com>
In article <Pine.GSO.4.02A.9906220823040.1698-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> Did you 'make test'? That's a good idea before 'make install'. Cheers!
>
Yeah, I did, but test.pl was simply the one generated by XS so all it
tested was if the module loaded, which it does. I don't have the problem
with 'use', but when I try to call the function defined in the
module. (i.e. &draw_mandel)
Thank you,
Kellan
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 6121
**************************************