[15667] in Perl-Users-Digest
Perl-Users Digest, Issue: 3080 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 17 18:16:01 2000
Date: Wed, 17 May 2000 15:15:34 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <958601733-v9-i3080@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 May 2000 Volume: 9 Number: 3080
Today's topics:
Re: Shopping cart problems <godzilla@stomp.stomp.tokyo>
Re: Shopping cart problems (brian d foy)
Re: Shopping cart problems <lr@hpl.hp.com>
simple newbie question d.frost@dtn.ntl.com
Simple Search - Please help <hwcs@lebois.com>
Re: Simple Search - Please help <lauren_smith13@hotmail.com>
Re: suid problem under Solaris 2.7 riglerej@my-deja.com
Re: suid problem under Solaris 2.7 <andrew.mcguire@walgreens.com>
Re: They won't allow perl! <rootbeer@redcat.com>
Re: They won't allow perl! (Tad McClellan)
Re: They won't allow perl! <camerond@mail.uca.edu>
Threads and Perl for Win32 <LeonardT@Intelis-Inc.Com>
Re: using Net::Telnet without escape characters <rootbeer@redcat.com>
Re: weirdness with symbol ref and new version of perl <rootbeer@redcat.com>
Where are perldoc pages? <occitan@esperanto.org>
Re: Where are perldoc pages? <rootbeer@redcat.com>
Re: Why does STDOUT->fdopen(...) work? <rootbeer@redcat.com>
Windows on windows <Luc-Etienne.Brachotte@wanadoo.fr>
Re: Windows on windows <aqumsieh@hyperchip.com>
Re: Windows on windows <lauren_smith13@hotmail.com>
Re: Windows on windows <mjcarman@home.com>
Re: xs: getting a char* into my Perl script (Ilya Zakharevich)
Re: zen and the art of trolling [OT] <bmb@dataserv.libs.uga.edu>
Re: zen and the art of trolling [OT] <godzilla@stomp.stomp.tokyo>
Re: zen and the art of trolling [OT] <bmb@dataserv.libs.uga.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 May 2000 12:17:59 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Shopping cart problems
Message-Id: <3922F067.98163D5A@stomp.stomp.tokyo>
"K. Scott Vowels" wrote:
> *Disclaimer* Keep the flames to a minimum, I am not a coder.
No problem, I am a well educated airhead.
> A friend is developing a shopping cart function in Perl
> and is having problems getting the information on the
> first form to replicate onto upstream forms. It appears
> to be clearing the session when it refreshes in the next
> form. Any thoughts or clues?
(snipped)
I have no clue on much of anything but do
often have airhead thoughts while whistling
through my ears.
Bucket Brigade, an old fashion way of
quelching a fire at Nancy Ann's Brothel.
Logic on this Scott, is to have your beer
buddy declare input as a global variable,
applies everywhere. Then pass this along
via the next form action print, the next,
the next, until the fire is under control.
I can't post code for you not knowing what
you are using for a program but hopefully
I can post enough information to help you.
Your script prints a form action with a
text input field box, say for first name.
I am keeping this simple, no code.
<...TYPE="text" NAME="Name" ..(NO VALUE SET)>
Visitor types in "Billyray" into your form
action text field box. This sets the VALUE.
Script read & parse generates NAME=Billyray
Declare a global right off:
$name = $in{Name};
Later, in your script, you may pass this
name along by a hidden field or by setting
a text field box VALUE to $name.
print "(next form action and all that..)
<...TYPE="hidden"..etc.. VALUE=$name>
OR
print "(same form action stuff)
<...TYPE="text"..etc.. VALUE=$name>
First example, you simply pass along data
by adding more hidden fields as more data
comes in. Second one, you are presetting
the value of a text box, "Billyray" would
automatically show in this text box. Trick
is in declaring a global $name so it can
be passed along with subsequent form
action prints.
In a nutshell:
First visit: data input
Read & Parse
Declare globals for input
Print a new form action
Pass along data in form action
Print a new form action
Pass along data in form action...
Over and over until you reach
final end. Then you can print
all your variables to be confirmed
by your visitor or corrected.
Oh goodness, airhead me. I do have
some code for you afterall.
Scott, this code will exemplify very well
those principles I have discussed here.
Upload this to your server and play!
My code's intent is to show principles
via testing rather than perfection.
This script is for testing, it affords
zero security. You will need to change
your Perl locale and possibly may need
to provide a full URL path for 'test.cgi'
where I have it in my form actions. You
know what to do on this. My script is
portable, Perl 4 or Perl 5 is fine.
My expectations are you will modify
this code and truly play with this.
I did toss in some radio buttons at a
certain point to show how to strictly
control user input, this is, have your
input _exactly_ how you want it. You
will also see $control in there. Study
this feature. It is important.
At the final stage, you could add in
a complete form action with all variables
printed in, for visitor correction. No
problem figuring out how do this, right?
Godzilla!
Some of my longer lines may word wrap
in your news reader. Be careful.
_______________________________________
#!/usr/local/bin/perl
print "Content-Type: text/html\n\n";
print "
<HTML><HEAD><TITLE>Form Examples</TITLE></HEAD><BODY>
<CENTER><BR><BR>";
&Parse;
sub Parse
{ # Parse #
local (*in) = @_ if @_;
local ($i, $key, $value);
read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
@in = split(/&/,$in);
foreach $i (0 .. $#in)
{
$in[$i] =~ s/\+/ /g;
($key, $value) = split(/=/,$in[$i],2);
($value eq "") && next;
$key =~ s/%(..)/pack("c",hex($1))/ge;
$value =~ s/%(..)/pack("c",hex($1))/ge;
$in{$key} .= $value;
}
return 1;
} # Parse #
# Declare Globals:
$name = $in{Name};
$hair_color = $in{Hair_Color};
$gender = $in{Gender};
$body_part = $in{Body_Part};
# Set a global CONTROL to change:
$control = $in{Control};
# Print Opening Page:
if ($control eq "")
{
print "
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
Enter Your First Name:<BR>
<INPUT TYPE=\"text\" SIZE = \"30\" NAME=\"Name\"><P>
<INPUT TYPE=\"hidden\" NAME=\"Control\" VALUE=\"two\">
<INPUT TYPE=\"submit\" NAME=\"Button\" VALUE=\"Test\">
</FORM>";
}
# Generate Second Page
# Add a hidden field:
if ($control eq "two")
{
print "
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
Enter Your Hair Color:<BR>
<INPUT TYPE=\"text\" SIZE = \"30\" NAME=\"Hair_Color\"><P>
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Control\" VALUE=\"three\">
<INPUT TYPE=\"submit\" NAME=\"Button\" VALUE=\"Test\">
</FORM>";
}
# Generate Third Page
# Add another hidden field:
if ($control eq "three")
{
print "
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
Select Your Gender:<BR>
Male:
<INPUT TYPE=\"radio\" NAME=\"Gender\" VALUE=\"male\">
Female:
<INPUT TYPE=\"radio\" NAME=\"Gender\" VALUE=\"female\">
<P>
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Hair_Color\" VALUE=\"$hair_color\">
<INPUT TYPE=\"hidden\" NAME=\"Control\" VALUE=\"four\">
<INPUT TYPE=\"submit\" NAME=\"Button\" VALUE=\"Test\">
</FORM>";
}
# Generate Final Form Action
# Add another hidden field:
if ($control eq "four")
{
print "
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
Enter A Favorite Body Part:<BR>
<INPUT TYPE=\"text\" SIZE = \"30\" NAME=\"Body_Part\"><P>
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Hair_Color\" VALUE=\"$hair_color\">
<INPUT TYPE=\"hidden\" NAME=\"Gender\" VALUE=\"$gender\">
<INPUT TYPE=\"hidden\" NAME=\"Control\" VALUE=\"five\">
<INPUT TYPE=\"submit\" NAME=\"Button\" VALUE=\"Test\">
</FORM>";
}
# Final Page And Print Results
# At this stage, you could add in a
# form action to correct information
# by adding a sub-routine call here:
if ($control eq "five")
{
if ($gender eq "male")
{ $sex = "his" }
else
{ $sex = "her" }
print "
$name has $hair_color hair and $name likes<BR>
to scratch $sex $body_part!<P><P>
<FORM ACTION=\"test.cgi\" METHOD=\"POST\">
<INPUT TYPE=\"hidden\" NAME=\"Control\" VALUE=\"\">
<INPUT TYPE=\"submit\" NAME=\"Button\" VALUE=\"Test Again\">
</FORM>";
}
print "
</CENTER></BODY></HTML>";
exit;
------------------------------
Date: Wed, 17 May 2000 15:26:07 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Shopping cart problems
Message-Id: <brian-1705001526070001@rtp-cr45-dhcp-100.cisco.com>
In article <3922F067.98163D5A@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
\>sub Parse
> { # Parse #
> $in{$key} .= $value;
> }
> return 1;
> } # Parse #
another badly coded, ill tested, and buggy CGI data parser.
you can't simply append values to each other because you lose
their identity in the process. there is no way to knwo which bits
go where afterwards. use an anonymous array for such a thing.
better yet, stop reinventing bugs and use a module.
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 17 May 2000 12:49:13 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Shopping cart problems
Message-Id: <MPG.138c979476079ff898aa95@nntp.hpl.hp.com>
In article <brian-1705001526070001@rtp-cr45-dhcp-100.cisco.com> on Wed,
17 May 2000 15:26:07 -0500, brian d foy <brian@smithrenaud.com> says...
> In article <3922F067.98163D5A@stomp.stomp.tokyo>, "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
>
> >sub Parse
> > { # Parse #
>
> > $in{$key} .= $value;
> > }
> > return 1;
> > } # Parse #
>
> another badly coded, ill tested, and buggy CGI data parser.
>
> you can't simply append values to each other because you lose
> their identity in the process. there is no way to knwo which bits
> go where afterwards. use an anonymous array for such a thing.
You forgot this part:
> > My script is portable, Perl 4 or Perl 5 is fine.
Anonymous arrays weren't supported in Perl 4.
> better yet, stop reinventing bugs and use a module.
You're joking!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 17 May 2000 21:32:14 +0000
From: d.frost@dtn.ntl.com
Subject: simple newbie question
Message-Id: <ZcEU4.2602$86.44993@news2-win.server.ntlworld.com>
Hi everyone,
I have just started to learn perl. I am interested in how to put sub routines into their own files, and use them from other programs ?
thanks for the help.
Dave
------------------------------
Date: Wed, 17 May 2000 14:10:20 -0600
From: "Matt Stanley" <hwcs@lebois.com>
Subject: Simple Search - Please help
Message-Id: <wTCU4.7$_t4.2241@news03.micron.net>
I am trying to implement the Simple Search from Matt's Script Archive on our
site and apparently I'm missing something, because it's not working. When
trying to use the search (http://www.hwcs.com/corporate/search_new.html) it
gives the following error:
"Internet Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.
Please contact the server administrator, webmaster@hwcs.com and inform them
of the time the error occurred, and anything you might have done that may
have caused the error.
More information about this error may be available in the server error log."
I following the readme directions explicitly but I obviously missed
something. I also read the faqs and all documentation but can't seem to
figure out what's wrong.
Below the body of this message are the pasted contents of my search.pl file
in hopes that someone might be able to see something I'm missing. I uploaded
the search.pl file into our cgi-bin directory and then used my FTP client's
permissions option (chmod) to assign read-execute permissions to the file.
The script is there, chmod has been run, the html file is properly calling
the script so far as I can tell and I have assigned all the variables
according to how our site is laid out but it's not working.
Please take a look & advise me on how to fix this and thanks much in advance
for your assistance!
--
Sincerely,
Matt Stanley
Webmaster,
H&W Computer Systems, Inc.
-------------------------------------
E-mail: mswork@micron.net
Web: http://www.hwcs.com
-------------------------------------------------------------------
search.pl contents:
#!/usr/bin/perl
############################################################################
##
# Simple Search Version 1.0
#
# Copyright 1996 Matt Wright mattw@worldwidemart.com
#
# Created 12/16/95 Last Modified 12/16/95
#
# Scripts Archive at: http://www.worldwidemart.com/scripts/
#
############################################################################
##
# COPYRIGHT NOTICE
#
# Copyright 1996 Matthew M. Wright All Rights Reserved.
#
#
#
# Simple Search may be used and modified free of charge by anyone so long as
#
# this copyright notice and the comments above remain intact. By using this
#
# code you agree to indemnify Matthew M. Wright from any liability that
#
# might arise from it's use.
#
#
#
# Selling the code for this program without prior written consent is
#
# expressly forbidden. In other words, please ask first before you try and
#
# make money off of my program.
#
#
#
# Obtain permission before redistributing this software over the Internet or
#
# in any other medium. In all cases copyright and header must remain
intact.#
############################################################################
##
# Define Variables #
$basedir = '/www/';
$baseurl = 'http://www.hwcs.com/';
@files =
('corporate/','email/','services/','support/','systems/','wizard/','y2k_tool
s');
$title = "H&W Computer Systems, Inc.";
$title_url = 'http://www.hwcs.com/';
$search_url = 'http://www.hwcs.com/corporate/search_new.html';
# Done #
############################################################################
##
# Parse Form Search Information
&parse_form;
# Get Files To Search Through
&get_files;
# Search the files
&search;
# Print Results of Search
&return_html;
sub parse_form {
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
}
sub get_files {
chdir($basedir);
foreach $file (@files) {
$ls = `ls $file`;
@ls = split(/\s+/,$ls);
foreach $temp_file (@ls) {
if (-d $file) {
$filename = "$file$temp_file";
if (-T $filename) {
push(@FILES,$filename);
}
}
elsif (-T $temp_file) {
push(@FILES,$temp_file);
}
}
}
}
sub search {
@terms = split(/\s+/, $FORM{'terms'});
foreach $FILE (@FILES) {
open(FILE,"$FILE");
@LINES = <FILE>;
close(FILE);
$string = join(' ',@LINES);
$string =~ s/\n//g;
if ($FORM{'boolean'} eq 'AND') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if (!($string =~ /$term/i)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if (!($string =~ /$term/)) {
$include{$FILE} = 'no';
last;
}
else {
$include{$FILE} = 'yes';
}
}
}
}
elsif ($FORM{'boolean'} eq 'OR') {
foreach $term (@terms) {
if ($FORM{'case'} eq 'Insensitive') {
if ($string =~ /$term/i) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
elsif ($FORM{'case'} eq 'Sensitive') {
if ($string =~ /$term/) {
$include{$FILE} = 'yes';
last;
}
else {
$include{$FILE} = 'no';
}
}
}
}
if ($string =~ /<title>(.*)<\/title>/i) {
$titles{$FILE} = "$1";
}
else {
$titles{$FILE} = "$FILE";
}
}
}
sub return_html {
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title>Results of Search</title>\n </head>\n";
print "<body>\n <center>\n <h1>Results of Search in $title</h1>\n
</center>\n";
print "Below are the results of your Search in no particular order:<p><hr
size=7 width=75%><p>\n";
print "<ul>\n";
foreach $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
}
}
print "</ul>\n";
print "<hr size=7 width=75%>\n";
print "Search Information:<p>\n";
print "<ul>\n";
print "<li><b>Terms:</b> ";
$i = 0;
foreach $term (@terms) {
print "$term";
$i++;
if (!($i == @terms)) {
print ", ";
}
}
print "\n";
print "<li><b>Boolean Used:</b> $FORM{'boolean'}\n";
print "<li><b>Case $FORM{'case'}</b>\n";
print "</ul><br><hr size=7 width=75%><P>\n";
print "<ul>\n<li><a href=\"$search_url\">Back to Search Page</a>\n";
print "<li><a href=\"$title_url\">$title</a>\n";
print "</ul>\n";
print "<hr size=7 width=75%>\n";
print "Search Script written by Matt Wright and can be found at <a
href=\"http://www.worldwidemart.com/scripts/\">Matt's Script Archive</a>\n";
print "</body>\n</html>\n";
}
------------------------------
Date: Wed, 17 May 2000 13:42:42 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Simple Search - Please help
Message-Id: <8fv08o$fkk$1@brokaw.wa.com>
Matt Stanley <hwcs@lebois.com> wrote in message
news:wTCU4.7$_t4.2241@news03.micron.net...
> I am trying to implement the Simple Search from Matt's Script Archive on
our
> site and apparently I'm missing something, because it's not working. When
> trying to use the search (http://www.hwcs.com/corporate/search_new.html)
it
> gives the following error:
>
> "Internet Server Error
>
> <blah blah blah>
>
> More information about this error may be available in the server error
log."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Did you miss this line?
Posting the error in the error log would be much more helpful than posting
the entire (?) source of a buggy program.
>
> I following the readme directions explicitly but I obviously missed
> something. I also read the faqs and all documentation but can't seem to
> figure out what's wrong.
Obviously you didn't read *all* the documentation. perlfaq9: My CGI script
runs from the command line but not the browser. (500 Server Error)
Lauren
------------------------------
Date: Wed, 17 May 2000 19:30:18 GMT
From: riglerej@my-deja.com
Subject: Re: suid problem under Solaris 2.7
Message-Id: <8furvi$ro9$1@nnrp1.deja.com>
In article <3922CD92.7236F5E9@walgreens.com>,
"Andrew N. McGuire" <andrew.mcguire@walgreens.com> wrote:
> [ posted & mailed ]
>
> riglerej@my-deja.com wrote:
> >
> > Before I get hundreds of responses telling me that writing suid
scripts
> > is BAD, I will just say that I am very aware of the potential
problems,
> > and trust my own programming skills to create a simple, secure
script
> > for modifying my /etc/group file.
>
> What is wrong with groupadd, groupmod, and groupdel?
> You will find them on both Solaris and Linux.
>
If you know of a way for an ordinary user to use these, I would be very
indebted to you for the information, but I've not seen a way to do this
to my satisfaction. I suppose I could make these commands suid, but I
think that would definitely open up some security problems. My program
limits the ability to modify the /etc/group file solely to the first
user listed for that group, and only allows them to change entries for
that specific group. I don't think groupmod is capable of anything like
this.
> > Now, as of a few months ago, I was running PERL 5.004. It was an
> > installation put in before I began working at my job. IMHO, it was
a
> > botched installation, so I decided to upgrade to 5.005_3, and try to
> > install it properly. Everything has gone beautifully, except that a
> > SUID root script I wrote no longer works properly.
>
> What errors does it give, which part is broken? Post some minimal
> code that illustrates your problem, and you will be better helped.
>
Hmmm, I've since discovered that the problem is probably not with perl
honoring the suid bit, but rather a symbolic reference problem. I've
posted another question related to this, complete with sample code and
the error message. I'll let this thread die, but I would still like to
read some more info on sperl. Thanks anyway!
>
> > Any ideas? Can somebody point me to docs on sperl (I'd like to
enable
> > this anyway, since I'm trying to homogenize my unix network, and I
have
> > a number of Linux machines that may make use of the suid script).
>
> I am not sure about sperl off hand, but you can probably do
> what you want without it.
>
> > Please CC jrigler@colorado.edu if you have a comment to the group,
as my
> > access to usenet is via deja.com and it's been kinda buggy lately.
>
> OK, but just this once. ;^)
>
> Regards,
>
> anm
> --
> /*-------------------------------------------------------.
> | Andrew N. McGuire |
> | andrew.mcguire@walgreens.com |
> `-------------------------------------------------------*/
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 17 May 2000 15:23:06 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: suid problem under Solaris 2.7
Message-Id: <3922FFAA.45512DF@walgreens.com>
riglerej@my-deja.com wrote:
>
> In article <3922CD92.7236F5E9@walgreens.com>,
> "Andrew N. McGuire" <andrew.mcguire@walgreens.com> wrote:
> > [ posted & mailed ]
> >
> > riglerej@my-deja.com wrote:
> > >
> > > Before I get hundreds of responses telling me that writing suid
> scripts
> > > is BAD, I will just say that I am very aware of the potential
> problems,
> > > and trust my own programming skills to create a simple, secure
> script
> > > for modifying my /etc/group file.
> >
> > What is wrong with groupadd, groupmod, and groupdel?
> > You will find them on both Solaris and Linux.
> >
>
> If you know of a way for an ordinary user to use these, I would be very
> indebted to you for the information, but I've not seen a way to do this
> to my satisfaction.
[ snip ]
sudo.
Regards,
anm
--
/*-------------------------------------------------------.
| Andrew N. McGuire |
| andrew.mcguire@walgreens.com |
`-------------------------------------------------------*/
------------------------------
Date: Wed, 17 May 2000 11:19:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: They won't allow perl!
Message-Id: <Pine.GSO.4.10.10005171119120.25459-100000@user2.teleport.com>
On Wed, 17 May 2000, Frank Krul wrote:
> I need help in coming up with an intelligent response to this:
Upgrade your employer. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 17 May 2000 15:27:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: They won't allow perl!
Message-Id: <slrn8i5slp.2ke.tadmc@magna.metronet.com>
On Wed, 17 May 2000 09:52:24 -0700, Frank Krul <fkrul@acc.com> wrote:
>I need help in coming up with an intelligent response to this:
>
>---------------------------------
>I also seriously think we should not install Perl on the Exodus
>machines.
>1. We do not know the stability of Perl running under NT for high volume
>
>sites.
But they *do* know the stability of NT for high volume sites?
And they are still planning to use NT?
Remarkable. Better brush up your resume...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 17 May 2000 15:26:54 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: They won't allow perl!
Message-Id: <3923008E.54311BF3@mail.uca.edu>
Frank Krul wrote:
>
> Hello,
>
> I need help in coming up with an intelligent response to this:
>
> ---------------------------------
> I also seriously think we should not install Perl on the Exodus
> machines.
> 1. We do not know the stability of Perl running under NT for high volume
>
> sites.
Well, this one you'll have to get an answer from someone who runs a
"high-volume" site, but IMHO, Perl 5.00503 from ActiveState is very
stable, I have no problems whatsoever on my "low-volume" website. You
should be able to get real data from their website, I would figure.
> 2. Perl runs out of the IIS process, every call to a perl script runs a
> separate instance of Perl. This can be resource
> intensive, and if there is something wrong with the script, it can
> potentially bring the whole server down.
Not so. ActiveState has a product called "PerlEx" (unfortunately, not
free, but really quite cheap for its functionality if you need it) which
does for IIS what mod_perl does for Apache. Or you could "roll your own"
Perl to be compatible with Apache and mod_perl, but that isn't
apparently what you want.
> I have used perl for years on UNIX, but do not know of it's inherent
> weaknesses on NT. Aby help would be appreciated.
AFAIK, there are only two weaknesses of Perl on NT. First, some
functions cannot be implemented: fork (although 5.6 has a Perl
fork-emulation), and signal handling) because of the NT architecture,
and second, NT itself is not as stable as some (all?) *n*x OS's. Note:
Neither of these problems are limited to the use of Perl.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Wed, 17 May 2000 18:00:44 -0400
From: "Leonard Thornton" <LeonardT@Intelis-Inc.Com>
Subject: Threads and Perl for Win32
Message-Id: <8fv4o3$4i7$1@slb7.atl.mindspring.net>
I have searched high and low, through FAQ's and outdated web pages and now I
must consult the pool of knowledge shimmering dank and dark herein...
Firstly, the environment: Win NT 4.0 SP4, Active Perl 522, VC++ 6.0,
partridge in a pear tree...
I wish to use Perl as a script language for performing unique tasks based on
varying information. The plan is to create a PerlEngine object which will
take a script filename as an argument, create a CperlHost object and parse
and run the script....simple so far.....this seems to work just fine.
Now, I create 24 threads, each with an instance of this PerlEngine object,
each running a copy of the same script file. No cigar...errors vary, but
suffice it to say that this does not appear to be threadsafe.
How can I run multiple threads, each executing the same of a differenct Perl
script? Suggestions? Experiences? Pointers to appropriate documentation?
Thanks in advance.
Leonard Thornton
Intelis, Inc.
leonardt@intelis-inc.com
------------------------------
Date: Wed, 17 May 2000 13:24:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: using Net::Telnet without escape characters
Message-Id: <Pine.GSO.4.10.10005171322350.25459-100000@user2.teleport.com>
On Wed, 17 May 2000 bahram22@my-deja.com wrote:
> I am using Net::telnet on ActivePerl on an WIN NT PC. I was wondering
> if there is a setting or an option that will turn off the escaper
> character sequences and have a normal stream output. For example, if I
> do a 'dir', I like to get a clean output stream with the dir listing
> only, and no escape sequences present.
Who is putting the escape sequences into your data? If Net::Telnet is,
there should be an option to disable that. But if you mean what I think
you mean, they're coming from the "other end". Of course, you could strip
them out of a string with a properly-constructed pattern. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 17 May 2000 13:34:53 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: weirdness with symbol ref and new version of perl
Message-Id: <Pine.GSO.4.10.10005171325250.25459-100000@user2.teleport.com>
On Wed, 17 May 2000 riglerej@my-deja.com wrote:
> my $OUT = lock($F);
Uh-oh. lock() is a built-in function (for threading purposes) in some
newer Perl releases - at least, it is some of the time. Could this be the
problem? (It shouldn't be... :-)
> sub lock {
> my $f = shift;
>
> $LOCKFILE = lockfilename($f);
Earlier, you showed 'use strict'. So, is this a global variable declared
with 'use vars'?
> $TMPFILE = sprintf("%s.%05d", $LOCKFILE, $$);
>
> unlink $TMPFILE;
> open(OUT, ">$TMPFILE") or die "$ME: open( >$TMPFILE ): $!\n";
Why aren't you using flock()?
> Can't use string ("/some/file") as a symbol ref while "strict refs"
> in
> use at perlscript.pl line 77, <IN> chunk 1.
What's line 77?
> I think this has something to do with how I return the filehandle from
> the "lock" subroutine, but I'm not sure.
Probably should be using a different way of making filehandles and
returning them. Have you seen the perlopentut manpage? That covers flock,
and a lot more. Maybe that'll get you closer to your solution. Good luck
with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 17 May 2000 21:12:48 GMT
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: Where are perldoc pages?
Message-Id: <8fv201$3e3$1@nnrp1.deja.com>
Saluton Retanoj!
I successfully installed Perl 5.6 on SuSE Linux 6.4 recently, but
perldoc can't find any of the pages like perlsyn or perlre. I don't see
a rule in perl-5.6.0/pod/Makefile that would copy these someplace.
Where should these be?
--
Bring text-docs to life! Erwecke Textdokumente zum Leben!
http://beam.to/iPerl/
Vivigu tekstodokumentojn!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 17 May 2000 14:35:33 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Where are perldoc pages?
Message-Id: <Pine.GSO.4.10.10005171430270.25459-100000@user2.teleport.com>
On Wed, 17 May 2000, Daniel Pfeiffer wrote:
> I successfully installed Perl 5.6 on SuSE Linux 6.4 recently, but
> perldoc can't find any of the pages like perlsyn or perlre.
Didn't install it right, did you? :-) Be sure to use 'make install'.
After 'make test', of course. If you rebuild and reinstall perl, it should
work.
> I don't see a rule in perl-5.6.0/pod/Makefile that would copy these
> someplace.
Have you tried 'make install.man'? But I always just 'make install'. You
should be able to run installman directly, if you're careful - but the
Makefile is the easier way.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 17 May 2000 14:42:35 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Why does STDOUT->fdopen(...) work?
Message-Id: <Pine.GSO.4.10.10005171438080.25459-100000@user2.teleport.com>
On Wed, 17 May 2000, Francis Litterio wrote:
> STDOUT->fdopen($file, 'w'); # Why does this work?
Perl cheats. :-) I think Perl just makes the filehandle work that way so
that this can work....
print STDOUT "Hello, world\n";
...as something like this:
STDOUT->print("Hello, world\n");
Not that I know where it's documented to be this way. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 17 May 2000 20:13:01 +0200
From: Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr>
Subject: Windows on windows
Message-Id: <3922E12D.28CFDB43@wanadoo.fr>
I would like to know if it is possible in Perl for win32, to develop a
graphic interface.
Il would like to setup a simple windows, with menus, and very simple
graphics (or just text), for calling Perl code. Is it possible to code
the win32 code and callback functions in Perl?
Thank you.
------------------------------
Date: Wed, 17 May 2000 19:03:22 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Windows on windows
Message-Id: <7abt25atj8.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>
Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr> writes:
> I would like to know if it is possible in Perl for win32, to develop a
> graphic interface.
Yep. You have to download and install the Tk module to do that. You can
use ppm to do that.
> Il would like to setup a simple windows, with menus, and very simple
> graphics (or just text), for calling Perl code. Is it possible to code
> the win32 code and callback functions in Perl?
Yes.
--Ala
------------------------------
Date: Wed, 17 May 2000 12:00:16 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Windows on windows
Message-Id: <8fuq8l$bds$1@brokaw.wa.com>
Luc-Etienne Brachotte <Luc-Etienne.Brachotte@wanadoo.fr> wrote in message
news:3922E12D.28CFDB43@wanadoo.fr...
> I would like to know if it is possible in Perl for win32, to develop a
> graphic interface.
Look into the Tk modules.
Lauren
------------------------------
Date: Wed, 17 May 2000 14:06:31 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Windows on windows
Message-Id: <3922EDB7.4C0FDC5D@home.com>
Luc-Etienne Brachotte wrote:
>
> I would like to know if it is possible in Perl for win32, to develop a
> graphic interface.
> Il would like to setup a simple windows, with menus, and very simple
> graphics (or just text), for calling Perl code. Is it possible to code
> the win32 code and callback functions in Perl?
Sure, you want Perl/Tk. Their newsgroup is just next door.
(comp.lang.perl.tk) You can download the Tk module from CPAN, and a
search there should turn up some useful reference materials. There are
of course also books on the subject, and the Tk module includes a good
little widget demo (just type 'widget' at your command line) that should
get you going in the right direction.
-mjc
------------------------------
Date: 17 May 2000 18:14:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: xs: getting a char* into my Perl script
Message-Id: <8funhu$2qq$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Ulrich Ackermann
<uackermann@orga.com>],
who wrote in article <39224B74.A3E16EB2@orga.com>:
> Thanks for replying :-)
NO thanks for a stealth Cc! Please do not do it again! Mark up your
messages as Cc's of a posting.
> > char *
> > get_name()
> This is what I tried first, but it did not work. It gives me back
> something that looks like an adress to me (0xd0b81208).
Try again.
> > I do not think you want to program XS with so much knowledge of C.
>
> You are right. I do not *want* to, I have to. I have to test some
> functions in a C-Library and tried to get a bit familiar with xs, which
> caused more trouble than I could think of.
Use h2xs instead.
> > But anyway, here is the thing I would try:
> >
> > SV *
> > get_name()
> > PPCODE:
> > char *name = get_name();
> > EXTEND(sp,2);
Of course, this should have been SP. [Probably no difference on the
current implementation.]
> > PUSHs(&Perl_sv_yes);
Of course, it should have been PL_sv_yes, or sv_yes for compatibility
with older versions.
Ilya
------------------------------
Date: Wed, 17 May 2000 14:45:17 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <Pine.GSO.4.21.0005171443530.2260-100000@dataserv.libs.uga.edu>
On Wed, 17 May 2000, Godzilla! wrote:
> Brad Baxter wrote:
>
> > On Wed, 17 May 2000, Xah wrote:
>
> > > Dear Paul:
>
> > Dear Xah,
>
> > You hate Perl and you hate Americans. Why don't you get
> > a new job and move?
...
> I both ask and demand you desist posting
> commentary of a racially insulting intent.
I PROMISE! <hand on heart/>
--
Brad
------------------------------
Date: Wed, 17 May 2000 12:20:51 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <3922F113.4A6AE629@stomp.stomp.tokyo>
Brad Baxter wrote:
> I PROMISE! <hand on heart/>
Thank you.
How about we work on being friends?
=)
Kira
------------------------------
Date: Wed, 17 May 2000 15:28:07 -0400
From: Brad Baxter <bmb@dataserv.libs.uga.edu>
Subject: Re: zen and the art of trolling [OT]
Message-Id: <Pine.GSO.4.21.0005171527440.2260-100000@dataserv.libs.uga.edu>
On Wed, 17 May 2000, Godzilla! wrote:
> Brad Baxter wrote:
>
> > I PROMISE! <hand on heart/>
>
> Thank you.
>
> How about we work on being friends?
>
> =)
>
> Kira
>
But we're already friends.
--
Brad
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3080
**************************************