[8626] in Perl-Users-Digest
Perl-Users Digest, Issue: 2243 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 3 16:07:31 1998
Date: Fri, 3 Apr 98 13:00:27 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 3 Apr 1998 Volume: 8 Number: 2243
Today's topics:
Re: [SOURCE] rot90: New and better MIME format (Chris Adams)
changing perms w/CHMOD. (Jason C. Hill)
Conflict with HTTP module and Mail::Sender... Help? (John "Chris" Wren)
Re: contexts: is there such a thing as array? (Jason Gloudon)
Re: contexts: is there such a thing as array? (Jason Gloudon)
Re: contexts: is there such a thing as array? <andrew@erlenstar.demon.co.uk>
dup2 of main::STDERR indhiraa@hotmail.com
File Uploading... (Darryl Blackburn)
For all you newbies! Don't say I wasn't helpfull... (I R A Aggie)
Help! fork() and Net::Telnet (Dave Neuer)
HELP, my PERL program isn't running... <dswain@thetsn.com>
Re: internationalisation of MacPerl <neeri@iis.ee.ethz.ch>
Re: internationalisation of MacPerl (Andre L.)
Re: Is there a "Newsgroup" for Newbies to Perl? (I R A Aggie)
Re: Is there a "Newsgroup" for Newbies to Perl? (Tye McQueen)
Re: need help with regexp alternation problem <nagare@emrtc.nmt.edu>
Perl, SSLeay and Win32 <dajablon@SynthSoft.com>
Re: Purify Run on Perl5.004_04 Solaris 2.5.1(sparc) (Andrew E Page)
Randal Schwartz to speak in Boston (Chris Nandor)
RANT: All hail Perl! <jim.gillespie@ssmb.com>
Redirecting STDOUT,STDER more than once (Bill Glicker)
Re: Someone put my munged e-mail address on a spam list <jerryp.usenet@connected.demon.co.uk>
structs <brian@structure.student.umd.edu>
Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ (John L. Allen)
Re: Tie/bless vs. bless/tie and segmentation fault (Tye McQueen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Apr 1998 19:23:24 GMT
From: cadams@ro.com (Chris Adams)
Subject: Re: [SOURCE] rot90: New and better MIME format
Message-Id: <6g3cvc$coj$1@news.ro.com>
A M < > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I a o
c I m O C > > > > > > > > > > > > > > > > > > > > > n n
c C p n h I s k m o f w t T c s p p p t v t i r t t m p d l
o H s r i e e w o a h h o h o o o h e h n u h o t o e r y
r A l 3 i h n e s n r n e i o o p r p o r i c n e p a r h e B
d E o s a c p s m t s l u u t u s t n l h f t . f T h
i L n A t v e s a i a a l l i l e i k u t b a t a e e W a
n 0 p i e g n t t c i t d a o a c d h o s s o r r v
g P 1 r a e s e v s o t s h r n c w a I e e t k e t e u d e
A @ n d v e s e i i b s e h l t w n n b t t o
t T m 1 s e e n n t g o a n e i , o l s a l o e i i m a o e 1
o R o 9 e c r d i t h e n g n o . h i m l h l o d e p s
I r 9 n i y i n e a t r e f l r o w n l t t l f n l
C e 8 d o n d t t e t x c i e u a e t ? g t u t ' ?
K h , w e n g t i o a h t e t k a D l y s o I n o o l o t
e r d e h I n o l a r r h e d o d i b w u 0 0
S a T o m e . l t e t e t f t , n f b v +
L d o t t e e i o y m a t y o r h s n e p e o e \ _ /
O - m e h l r n e i e o o e e u h o s t r
N s : a s l n x u m Y r t t u t t
E t t e y t o i
. m c
e , a
d l
u
>
:
--
Chris Adams - cadams@ro.com
System Administrator - Renaissance Internet Services
I don't speak for anybody but myself - that's enough trouble.
------------------------------
Date: Fri, 03 Apr 1998 15:09:31 -0500
From: jhill@mitre.org (Jason C. Hill)
Subject: changing perms w/CHMOD.
Message-Id: <jhill-0304981509450001@jhill-mac.mitre.org>
for $i (@other_dir) {
opendir THISDIR, $i;
@all_files = readdir THISDIR;
for $j (@all_files) {
($dev, $ino, $mode, $nlink, $uid) = stat $j;
if ( $uid == 0 ) {
}
} #end inner for
closedir THISDIR;
} #end out for
What I'm doing is an array of directories and in those directories I'm
looking for files owned specifically by root [uid 0]. What I need to do
is change all group and world permissions such that they aren't
writeable. My problems is I don't think I can issue a chmod command like
this chmod g-w,o-w or something like that, I don't want to chnage any of
the other bits incase some of them are sticky.
Anyone ever run into this, or maybe have a simpler solution as to how to
change file permissions without knowing or changing the other permissions
of a file?
-Jason C. Hill
jhill@mitre.org
------------------------------
Date: Fri, 03 Apr 1998 20:29:27 GMT
From: jcwren@atlanta.com (John "Chris" Wren)
Subject: Conflict with HTTP module and Mail::Sender... Help?
Message-Id: <35364616.974144385@nntp.atlanta.com>
I'm trying to use the Mail::Sender module, and am running into
problems.
I have an application that makes extensive use of the HTTP
library, and it works just fine. However, as soon as I add the one
statement 'use Mail::Sender;', I start getting the following error:
syntax error at C:\perl\scripts\test.pl line 111, near "HTTP::Request
GET". Execution of C:\perl\scripts\e.pl aborted due to compilation
errors.
I looked through the Mail::Sender code, and don't see any
reason that I can guess at that should cause the HTTP modules to
break.
Does anyone have any experience or insight on this?
- John "Chris" Wren
---
John "Chris" Wren, KD4DTS
jcwren@atlanta.com
770-945-8288 (H)
770-840-9200 x2417 (W)
By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
meets the definition of a telephone fax machine. By Sec.227(b)
(1)(C), it is unlawful to send any unsolicited advertisement to
such equipment, punishable by action to recover actual monetary
loss, or $500, whichever is greater, for EACH violation.
------------------------------
Date: Fri, 03 Apr 1998 19:12:43 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: contexts: is there such a thing as array?
Message-Id: <slrn6iad0b.ab5.jgloudon@manitoba.bbn.com>
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
:>>>>> "Jason" == Jason Gloudon <jgloudon@manitoba.bbn.com> writes:
: >> $a = @hash{'a','b','c','d'};
:
: Jason> What list ? That's a hash slice, which is the same thing as
:
: Jason> @array = @hash{'a','b','c','d'};
: Jason> $ = @array;
^a - I forgot the a.
:Not quite:
:
:my %hash = (a=>1, b=>1, c=>1);
:my $a = @hash["a","b","c"];
(*) Isn't this an array slice of the non-existent array @hash ?
:print $a
:
:Output is: 1
Not in the 5.001, 5.003 and 5.004 I've tried. Copied the wrong output ?
:
:my %hash = (a=>1, b=>1, c=>1);
:my @a = @hash["a","b","c"];
Same comment as (*)
:my $a = @a;
:print $a
:
:Output is: 3
@a is an array of 3 undefs, not what i think you meant.
--
Jason Gloudon
------------------------------
Date: Fri, 03 Apr 1998 19:33:22 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: contexts: is there such a thing as array?
Message-Id: <slrn6iae72.ab5.jgloudon@manitoba.bbn.com>
Dan Boorstein <dboorstein@shopcfn.com> wrote:
>Jason Gloudon wrote:
>>
>> Spider Boardman <spider@Orb.Nashua.NH.US> wrote:
>> >Randal Schwartz wrote:
>> >> So, once again, there CANNOT BE A LIST IN A SCALAR
>> >> CONTEXT. EVER. WAKE UP AND SMELL THE COFFEE! :-)
The confusion stems from the fact that 'list' isn't being used in this manner:
>From the glossary of "Programming Perl" (First Edition):
List
An ordered set of values with a beginning and an end. Or, an attribute of a
leaning ship, decreasing in value, at the beginning of its end.
LIST
A Syntactic construct representing a comma-separated list of expressions,
evaluated to produce an array value. Each expression in a LIST is evaluated
in an array context.
Array Value
An unnamed list of scalar values that may be passed around within a program
and passed to any function that provides an array context.
My book is of course out-of-date, have these definitions changed ?
--
Jason Gloudon
------------------------------
Date: 03 Apr 1998 21:15:32 +0100
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: contexts: is there such a thing as array?
Message-Id: <87sonufyqj.fsf@erlenstar.demon.co.uk>
>>>>> "Jason" == Jason Gloudon <jgloudon@manitoba.bbn.com> writes:
Jason> (*) Isn't this an array slice of the non-existent array @hash ?
Oops. Yup, copied the wrong code. Try this for size, copied straight
from a shell window:
/u/andrew $ perl -v
This is perl, version 5.004_04 built for i386-freebsd
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
/u/andrew $ perl -w
my %hash = ( a=>1, b=>1, c=>1 );
my $a = @hash{'a','b','c'};
print "result is $a\n";
^D
result is 1
/u/andrew $ perl -w
my %hash = ( a=>1, b=>1, c=>1 );
my @a = @hash{'a','b','c'};
my $a = @a;
print "result is $a\n";
^D
result is 3
/u/andrew $
--
Andrew.
------------------------------
Date: Fri, 03 Apr 1998 13:52:58 -0600
From: indhiraa@hotmail.com
Subject: dup2 of main::STDERR
Message-Id: <6g3emq$gnk$1@nnrp1.dejanews.com>
Hi,
I am writing a Perl program in which I want all the error messages
to go to a file. So I tried to use dup2. Here is the code
#!/usr/local/bin/perl -w
use strict;
use FileHandle;
use POSIX;
my $errfd = POSIX::open($errFile, O_CREAT|O_APPEND, 0644);
(defined $errfd) or die "Can't open $errFile.. : $!\n";
## Get the filedescriptor for STDERR
my $std_err = FileHandle::fileno (main::STDERR);
dup2 ($errfd, $std_err);
### Testing stderr
print STDERR "stderr working..\n";
die "Error testing dup..\n";
It doesn't print on screen or in file.
What am I doing wrong..
Thanks,
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 3 Apr 1998 20:20:49 GMT
From: dblackbu@runet.edu (Darryl Blackburn)
Subject: File Uploading...
Message-Id: <6g3gb1$pju@newslink.runet.edu>
I wrote a perl script that allows users to upload a binary
file to the server. I did this on a unix box, however
I've been trying to port it to a 95 machine without success.
On the unix side, the file information comes in through stdin,
on the dos side, only a few bytes of data are passed in in this
manner. Anyone else ever have this problem? Does win95 pass
data around in some other manner??
Thanks,
--
------------------
------------------
Darryl Blackburn
Radford University
------------------------------
Date: Fri, 03 Apr 1998 14:55:20 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: For all you newbies! Don't say I wasn't helpfull...
Message-Id: <fl_aggie-0304981455200001@aggie.coaps.fsu.edu>
A repost out of my archives. This newbie problem isn't new...just
seemingly infinite.
James
--------begin repost----------
Date: 09 Nov 1995 02:57:30 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: system() question
There are a lot of reasons, many of which get repeated over and
over again, many of which don't. Some of the reasons you hear a lot
are: Questions are incoherently phrased. Questions have the form `my
code doesn't work' and don't include the code. Questions include the
code, and it's 200 lines long, and comp.lang.perl is not a debugging
service. Nobody knows the answer to the question. The question is so
badly punctuated that nobody can bear to read it. Questions aer
written by a non-native speaker of English and the native speakers who
are trying to understand it can't. (That's a shame, but it does
happen. I often wish that these people would post in their native
languages. I'd love to see more discussion in languages other than
English. Some Dutch guy tried posting all his comp.lang.c articles in
Dutch a few years ago, and all the Americans flamed him. How
humiliating for me!)
Apart from these oft-mentioned reasons are many others that are
not so often discussed, because anyone who tries to bring them up gets
flamed. But it's the truth: I know the reason I don't answer more
questions is because so many of them questions are so damn stupid.
They're stupid in a lot of different ways, but they're still stupid.
I don't want to suggest that that's why your questions go unanswered.
I don't know what you're asking. No doubt the reason your questions
go unanswered is because they're so deep and interesting that nobody
really knows the answer.
The most common stupid question is the one from someone who has
some high-level problem that they need solved. They have an idea that
they'd like to do it in perl, and they don't really know perl. So
instead of learning perl, they post to comp.lang.perl.misc.
Now don't get me wrong. I don't have any problems answering the
questions of someone who's trying to learn perl. I love THOSE
qusetions. But these people don't seem to be asking useful questions
for that.
Today, for example, I saw a question from a guy who wants to get a
list of hostnames out of nslookup. `How do I do that?' he says. And
it's hard to know what to make of that. What does he mean? Does he
not know how to open a pipe? Is his `open' command failing? What's
going on here? I can't give a useful answer without understanding the
problem. Having your `open' fail is a problem. Wanting to list
hostnames is not a problem; it's a desire.
Here are some similar questions that would have made more sense to me:
1. ``I'm a lazy asshole and I can't be bothered to learn to
program myself, but I know if I post here you'll give me
something for free.''
(OK, fair enough. At least I can send him a rate card.)
2. ``I'm trying to use `open' to talk to nslookup, but...
...here's my code; what's wrong?''
(Good question.)
3. ``I know perl has a `system' command for running programs,
but I can't see how to get my commands into nslookup
once I have run it.''
(Good question.)
4. ``I'm trying to use `getprotobynumber' to talk to nslookup...''
(Good question.)
See, I'm not just biting people's heads off, here. #4 is a good
question, because it gives me something to work with. OK, he has a
very weird idea about interprocess communication, but that's
ignorance, and that's what we're here to correct. He doesn't know
about `open'; I can refer him to the manual.
Here's another example: Some guy wants to assemble a list of email
addresses . ``How do I do that?'' he wants to know. Well, duh. Get a
big pad of paper and read news for a couple days and write down all
the addresses you see. Problem solved. What's it doing in
comp.lang.perl?
Oh, you wanted to do it in perl. Well, I guess I'd open a socket
to the NNTP server and send it some XHDR commands for the `From'
lines. But that's not Perl; you could do that in any language. I
could do it in Bourne Shell for you if I'm allowed to use a little
external thingie to handle the socket parts for me. What's it doing
in comp.lang.perl?
Oh, you wanted us to write the program for you? Wait, let me send
you my rate card.
Someone posted yesterday asking how to get the data from a file
where the start and end of the data is marked by keywords. Same thing
going on here. ``Well, here's how you solve your problem: First you
go take an introductory class in programming and learn to write
programs in some language. Then you go to the bookstore and buy this
book by Wall and Schwartz, it's really good. Read the book carefully
and try out the examples. Then if you still have general questions
like `How do I do this' instead of `I thought that this code would do
X but instead it does Y' you hire a professional to write your program
for you. Or you could just skip right to step 3. Want my rate
card?''
The worst stupid questions are the ones that come from people who
have no business asking them. The most perfect example of this that I
could have imagined was in comp.unix.questions a couple of years ago.
Some guy came and asked how you could tell if a file is a hard link.
My jaw flapped open and it's stayed open since then. I couldn't have
been any more stumped if he'd asked why Bodhidharma came from the
West. What do you say to this guy? Do you tell him the truth, that
all files are hard links, that even symbolic links are hard links?
He's not going to understand you; you might as well keep your mouth
shut. Do you tell him the truth, that the answer won't do him any
good because he doesn't know what a hard link is, so why did he bother
asking in the first place? No, that'll just make him mad. I followed
that message for the next couple weeks, and nobody said anything.
What could you say? The guy had no business asking the question and
no use for the answer. Maybe the right answer would have been to cut
off his finger or something. I dunno.
Some questions get ignored because they're boring. Someone asked
today how to compare two variables (I assumme he means the contents of
those variables) to see if they're exactly the same. You've gotta be
in an awfully good mood to take the time to answer that. Maybe
someone will. Maybe I will.
If I answer that one today, maybe he'll be back tomorrow asking
how to check to see if two variables contain different values. Maybe
I won't. What I find incredible is that if you tell these people to
go read the manual and come back in two weeks, you sometimes get
jumped on for not being helpful to beginners. Bah. If everyone told
these people to go read the manual, they'd eventually figure out that
that's what you have to do ,and then I wouldn't have to spend so much
of my life dealing with incompetent programmers.
Some questions are logically nonsensical because the querent
thinks they know more than they do. A lot of these have the form
``How do I use X to accomplish Y?'' There's nothing wrong with this,
except that sometimes X is a chocolate-covered banana and Y is the
integration of European currency systems. I always get stuck on
these, probably because I can't get rid of the idea that the person
really has a good reason for wanting to use X. I know a half-dozen
easy simple ways to accomplish Y, but I can't imagine what X has to do
with it. This is a problem for me in my day job, too. Clients are
always saying to me ``We want to use product X to do multimedia
development on the world-wide web,'' and all I can think is ``Well,
gee, what would you want to go and do that for?'' Sometimes it turns
out that they want to do it because they want to impress the
manufacturers of X, and I don't work on those jobs.
The flip side of this is a questions like ``I want to accomplish
X, but I don't want to use Y. What can I use instead?'' Which,
again, is sometimes reasonable, and then sometimes X is closing a
filehandle and Y is the `close' function.
The questions I like the best are the ones that go like this:
``I want to accomplish X.
I thought that the following code fragment would do it:
...
But instead it does Y.
Why is that?''
This one is also pretty good:
``I want to accomplish X.
I thought I might be able to use facility Y.
But Y doesn't seem like it's quite right,
because of Z.
What should I use instead of Y, or how can I overcome Z?''
When I ignore these, it's usually because I don't know the answer.
There were an awful lot of them today. It makes me very happy.
There you go; a 160-line dissertation on why questions go unanswered.
Now don't let me hear you saying nobody ever answers your questions.
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 3 Apr 1998 20:29:38 GMT
From: daven@ldr.com (Dave Neuer)
Subject: Help! fork() and Net::Telnet
Message-Id: <daven-0304981229310001@daven.ldr.com>
I originally posted this to comp.lang.perl.modules, but I am reposting it
here, because the traffic on the modules group seems unusually light
today:
I am writing a GUI app to simplify a multi-step process of telnetting into
a remote machine, setting some environment variables and issuing a
command. I'm using Perl 5.004, Perl/TK 400.200 and Net::Telnet (couldn't
tell you what version, I think it's the most recent).
Most of it is working OK (it Telnets in, issues the commands OK). My
problem is that the main command doesn't return until a remote user
dismisses a window that pops up on their terminal as a result of the
command. If the command is run from the command line, and the local user
gets tired of waiting for the remote user to dismiss the window, they can
just interrupt the command with Control-C. This has the side effect of
also dismissing the remote window.
My problem is that I would like to give the user of my GUI front end to
this series of commands the option to bail on the command just like they
could from the command line, without having to quit the script. Presently
I can't figure out how to do this because the cmd() method of Net::Telnet
blocks until it gets the prompt signalling that the remote command
returned. What I want to do requires that I update the GUI while the
remote process is hanging, waiting for the remote user's response.
I know Perl isn't presently multi-threaded, and I thought about trying to
write this in Java, but I love Perl and I don't know if there is a Java
package that's as powerful and simple as Net::Telnet, which I'm also quite
fond of.
Is there any way to fake this kind of threaded behavior in Perl? I read
in "Advanced Perl Programming" that after a fork() call, "[the] newly
created child process . . . has a copy of its parent's environment and
shares all open file descriptors." My understanding is that a socket is a
file descriptor, but what about a Net::Telnet object? It presumably
contains a socket or a reference to a socket, but if I fork a child
process will both the child and the parent have access to the object and
its methods (and more importantly with both processes copies of the object
really point to the open socket on the remote end)? This somehow seems
unlikely to me.
It's important though, because the child needs to be able to issue the
command in the first place so that it can be the one hanging around
waiting, but the parent needs to be able to either:
a) access the Telnet object and issue a Control-C sequence to interrupt
the remote command, or
b) kill the child process.
My gut feeling is that the latter is the way to go. Something like:
$pid = fork();
if (!(defined) $pid){
Die "Fork failed, bummer: $!\n";
} else {
if ($pid == 0){ #child process
$t = new Net::Telnet();
$t->open($host);
$t->login($username, $password);
$ok = $t->cmd(String => $command1, Timeout => 10);
#command 2 is the one that hangs until remote user
#does something
$ok2 = $t->cmd(String => $command2, Timeout => undef);
$t->close();
exit; #make sure that the child doesn't excecute parent's code
} else { #parent process
&clear();
}
sub clear{
#code to clear the entry fields of the GUI
#and change the button to say stop, set the
#button's action to call subroutine "kill"
}
sub kill{
if ((defined $pid) && ($pid != 0)){ kill $pid; }
}
Does anyone out there have any ideas on how to implement this type of
behavior? Did I just totally answer my own question?
I'd really hate for users to have to kill the whole GUI app, since
starting it up takes a little while and if I can get it working the way I
want it to, they can just keep the app running on their desktop and use it
periodically without the startup overhead.
Any insights would be greatly appreciated.
Sincerest thanks in advance,
Dave Neuer
------------------------------
Date: Fri, 03 Apr 1998 14:34:50 -0500
From: David Swain <dswain@thetsn.com>
Subject: HELP, my PERL program isn't running...
Message-Id: <352539DA.702B0710@thetsn.com>
--------------D5E2A61BFB4C5AED17EFB15D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello, I am new but detirmined. I need help!!!
I am running a cgi-perl script on a RED HAT Linux server release 4.0
(colgate)
KERNAL 2.0.28 on a i486
with perl 5.003
Ok, directory structure is like this
/bin/first.pl
/inetpub/intranet/first.html
...server admin said to put perl in bin directory as above, and html in
intranet directory.
perl is located in /usr/bin/perl
the following is my code "copied letter for letter from teach yourself
cgi in a week"
CGI:
#! /usr/bin/perl
print "Content-type: text/html\n\n";
print <<'ending_print_tag';
<html>
<head>
<title>test 1 - CGI</title>
<background="#000000" text="#FF0000">
</head>
</body>
<h1>test 1 - CGI</h1>
<em>hello</em>
<hr noshade>
this is boring
</body>
</html>
ending_print_tag
HTML:
<HTML>
<HEAD>
<TITLE>test first cgi</TITLE>
</HEAD>
<BODY>
<H2>Simple form</H2>
<HR>
<FORM METHOD="GET" ACTION="http://internal.thetsn.com/cgi-bin/first.pl">
<INPUT TYPE="submit">
</form>
<HR>
</BODY>
</HTML>
Now, admin said NOT to use:
<FORM METHOD="GET" ACTION="http://internal.thetsn.com/bin/first.pl">
but to use:
<FORM METHOD="GET" ACTION="http://internal.thetsn.com/cgi-bin/first.pl">
on netscape, if I use the top one /bin/first.pl, then I get to view it
in the browser when I push submit. On the second one, I get this
message:
Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster@omited.com and inform
them of the time the error occurred, and anything
you might have done that may have caused the error.
Please help me...admin said I had to figure it out on my own, but I've
spent 7 hours and I am getting nowhere.
David Swain
dswain@thetsn.com
--------------D5E2A61BFB4C5AED17EFB15D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
Hello, I am new but detirmined. I need help!!!
<BR>I am running a cgi-perl script on a RED HAT Linux server release 4.0
(colgate)
<BR>KERNAL 2.0.28 on a i486
<BR>with perl 5.003
<P>Ok, directory structure is like this
<P>/bin/first.pl
<BR>/inetpub/intranet/first.html
<P>...server admin said to put perl in bin directory as above, and html
in intranet directory.
<BR>perl is located in /usr/bin/perl
<P>the following is my code "copied letter for letter from teach yourself
cgi in a week"
<P>CGI:
<BR>#! /usr/bin/perl
<BR>print "Content-type: text/html\n\n";
<P>print <<'ending_print_tag';
<BR><html>
<BR><head>
<BR><title>test 1 - CGI</title>
<BR><background="#000000" text="#FF0000">
<BR></head>
<BR></body>
<BR><h1>test 1 - CGI</h1>
<BR><em>hello</em>
<BR><hr noshade>
<BR>this is boring
<BR></body>
<BR></html>
<BR>ending_print_tag
<BR>
<P>HTML:
<BR><HTML>
<BR><HEAD>
<BR> <TITLE>test first cgi</TITLE>
<BR></HEAD>
<P><BODY>
<BR><H2>Simple form</H2>
<BR><HR>
<BR><FORM METHOD="GET" ACTION="<A HREF="http://internal.thetsn.com/cgi-bin/first.pl">http://internal.thetsn.com/cgi-bin/first.pl</A>">
<BR><INPUT TYPE="submit">
<BR></form>
<BR><HR>
<P></BODY>
<BR></HTML>
<P>Now, admin said NOT to use:
<BR><FORM METHOD="GET" ACTION="<A HREF="http://internal.thetsn.com/bin/first.pl">http://internal.thetsn.com/bin/first.pl</A>">
<BR>but to use:
<BR><FORM METHOD="GET" ACTION="<A HREF="http://internal.thetsn.com/cgi-bin/first.pl">http://internal.thetsn.com/cgi-bin/first.pl</A>">
<P>on netscape, if I use the top one /bin/first.pl, then I get to view
it in the browser when I push submit. On the second one, I get this
message:
<P><FONT SIZE=+2>Server Error</FONT>
<P>The server encountered an internal error or misconfiguration and was
unable to complete your request.
<P>Please contact the server administrator, webmaster@omited.com and inform
them of the time the error occurred, and anything
<BR>you might have done that may have caused the error.
<P>Please help me...admin said I had to figure it out on my own, but I've
spent 7 hours and I am getting nowhere.
<P>David Swain
<BR>dswain@thetsn.com</HTML>
--------------D5E2A61BFB4C5AED17EFB15D--
------------------------------
Date: 03 Apr 1998 21:08:31 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: internationalisation of MacPerl
Message-Id: <86yaxmoh8w.fsf@gwaihir.ethz.ch>
hthetmeyer@ifm.uni-kiel.REMOVE.de (Helmut Thetmeyer) writes:
> In the perllocale manpage the author recognises:
>
> > but also for English: it would be very naove to think that
> > A-Za-z defines all the ``letters''.
>
> Indeed, it would be very useful if a programme for text manipulation
> processed a statement like $a = "\udnderung" as expected, i.e. change
> "dnderung" in "Dnderung".
Yes.
> Is it possible to make functions like "\u", "\L", or "uc" work with non
> ASCII characters on a Macintosh
I'm afraid I see no prospect for implementing this in the near future.
> If not, are there any external functions available which
> can use arbitrary conversion tables in expressions like "s/(\w+)/\u\L$1/g"
> ?
Hmm, I could of course interface to the MacOS Toolbox functions.
> BTW, would it be easier to cope with international text using Python?
Sigh... you're breaking my heart. Ask Jack Jansen, he probably knows.
Matthias
--
Matthias Neeracher <neeri@iis.ee.ethz.ch> http://www.iis.ee.ethz.ch/~neeri
"A system without PERL is like a hockey game without a fight."
-- Mitch Wright
------------------------------
Date: Fri, 03 Apr 1998 15:18:27 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: internationalisation of MacPerl
Message-Id: <alecler-0304981518270001@dialup-638.hip.cam.org>
(posted && mailed)
Helmut,
use locale;
$s = "andri"; # e acute
print uc($s); # prints 'ANDRI' (E acute)
This works fine in MacPerl 5.1.9r4, under System 7.5.5.
Do you have the file "locale.pm" in MacPerl's "lib" folder?
Greetings,
Andri
========================
In article <hthetmeyer-0304981931580001@bonito.ifm.uni-kiel.de>,
hthetmeyer@ifm.uni-kiel.REMOVE.de (Helmut Thetmeyer) wrote:
> In the perllocale manpage the author recognises:
>
> > but also for English: it would be very naove to think that
> > A-Za-z defines all the ``letters''.
>
> Indeed, it would be very useful if a programme for text manipulation
> processed a statement like $a = "\udnderung" as expected, i.e. change
> "dnderung" in "Dnderung". Case conversion of 8-bit characters (umlauts,
> accented characters etc.), however, does not work with MacPerl (5.1.9
> r.4). The manpage refers to the locale system (a so called standard) as
> solution to the 8-bit problem. The MacOS, however, does not support the
> locale system, and on our Unix workstations (DEC OSF/1) there is no locale
> system installed (yes, I could ask our admin to do this ...).
>
> Is it possible to make functions like "\u", "\L", or "uc" work with non
> ASCII characters on a Macintosh (no, I do not want to install Linux for
> that purpose)? If not, are there any external functions available which
> can use arbitrary conversion tables in expressions like "s/(\w+)/\u\L$1/g"
> ?
------------------------------
Date: Fri, 03 Apr 1998 14:49:54 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <fl_aggie-0304981449540001@aggie.coaps.fsu.edu>
In article <6g34ak$ah2@co-op.newsguy.com>, smitty77@pacbell.net wrote:
+ In article <fl_aggie-0304980949250001@aggie.coaps.fsu.edu>,
+ fl_aggie@thepentagon.com says...
+ >Perhaps. Remember that hardass teacher you had in highschool, who
+ >worked you hard? I bet you do. Do you remember the ones that spoonfed
+ >you? you don't? That's what I thought...
+ I pretty much figured your ego wouldn't allow to you get through this post
+ without getting silly. The teachers I remember are the ones who helped me the
+ most.
And which ones where those?
Dave, the teachers that helped me the most where the ones that showed me how
to find information, analyze the information, and then do something USEFUL
with the information.
Unless I miss my guess, that's the same type that helped you the most,
too.
And that's the point: its no sin to be a newbie. Its no sin to be
confused. It is a sin, however, to bug someone without attempting
to do your homework.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 3 Apr 1998 14:02:56 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6g3f9g$cbr@fohnix.metronet.com>
drummj@mail.mmc.org (Jeffrey Drumm) writes:
) The newbies may flock to the group, [...]
) [...] . . . well, with c.l.p.help becoming devoid of useful
) content, I suspect they'll be back here.
Many newbies don't seem to read c.l.perl.misc even for a day
before posting to it so they won't know whether c.l.perl.misc nor
c.l.perl.help provide useful help so they'll just cross-post most
questions to both groups as soon as c.l.perl.help is created.
The biggest problem with even trying this is that the number of
off-topic posts (such as this one) will increase as people argue
about what should be posted where and not cross-posted and flame
fests will become more common.
The most recent real problem is that those doing most of the work
to help all of us are letting their justifiable frustration lead
them to rash and rude treatment of the clueless and those they too
rashly judge as clueless. Seems like growing pains but the recent
attention to it seems to be curbing it. If we can all manage to
be civil then the cries for better resources for newbies will fade.
A c.l.p.moderated will eliminate much of the frustration which lead
up to this. Then the motivated newbies can have c.l.p.misc to try
whatever they want to try to make it newbie-friendly. If they can
manage to keep a continuous supply of freshly near-newbie readers
that don't mind quoting sections of FAQ lists over and over, then
they will probably do us all some good by providing a polite
introduction to the vast and valuable pre-written resources for
those who don't manage to find that introduction in prewritten form
no matter how hard you try to make it obvious to them.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Fri, 03 Apr 1998 12:19:11 -0700
From: Josh England <nagare@emrtc.nmt.edu>
Subject: Re: need help with regexp alternation problem
Message-Id: <3525362E.B0093BBD@emrtc.nmt.edu>
smitty77@pacbell.net wrote:
> >/(Jan\s{1,2}([5-9]|[1-2][0-9]|[3][0-1]).{12}98|
> >(Feb)\s{1,2}([1-9]|[1-2][0-9]|[3][0-1]).{12}98|
> >Mar\s{1,2}([1-9]|[1][0-9]|[2][0-7]).{12}98)/
>
> This worked fine for me, but I had to change your .{12} to .{16} to work for the
> output of HP-UX's 'date' command (which I assume is the same as every other UNIX
> 'date' command - I don't know why yours would be different). I used your exact
> regex without any new parens.
>
> Dave
>
This still does not work for me. I am using perl 5.004. Do I need to
upgrade/recompile perhaps? It will match anything a date described before the first
| above (starting with Jan\s.....), but no dates after the first |.
BTW, I am the same guy who originated this thread. I posted using someone else's
profile on accident. It does not search through 'date' specifically, but a very
similar date string.
Please help.
------------------------------
Date: Fri, 03 Apr 1998 11:56:08 -0800
From: "David A. Jablonski" <dajablon@SynthSoft.com>
Subject: Perl, SSLeay and Win32
Message-Id: <35253ED8.CE943E98@SynthSoft.com>
Hello,
Has anyone gotten the SSLeay.pm module compiled and installed in
Windows NT/95? Care to give me tips, or even better, send me the
binaries?
I am using Perl v5.004_04 and SSLeay v0.6.6. I would like to use
SSLeay.pm v0.04 if possible.
Please email responses to "dajablon@SynthSoft.com". Thanks!
--David
------------------------------
Date: Fri, 3 Apr 1998 19:24:26 GMT
From: aep@world.std.com (Andrew E Page)
Subject: Re: Purify Run on Perl5.004_04 Solaris 2.5.1(sparc)
Message-Id: <Equr8s.6wv@world.std.com>
Perl5.00463
I've put the result of this run in the following URL:
http://world.std.com/~aep/public_html/pure_make_test.log.gz
--
Andrew E. Page (Warrior Poet) | Decision and Effort The Archer and Arrow
Mac Consultant | The difference between what we are
Macintosh and DSP Technology | and what we want to be.
------------------------------
Date: Fri, 03 Apr 1998 15:15:08 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Randal Schwartz to speak in Boston
Message-Id: <pudge-0304981515230001@ppp-10.ts-1.kin.idt.net>
Author and Perl hacker Randal Schwartz will be giving his JACPH (Just
Another Convicted Perl Hacker) talk on Saturday, April 25, 1998
at 7 p.m. at the MIT Media Lab Auditorium.
----------------------------------------------------------------------
I will present a cronology of how I became a felon in the process of
doing what I thought was my job as a self-motivated innovative systems
administrator, in the well publicized Oregon v. Schwartz case (victim:
Intel). I'll include some points about Oregon's current law and the
implications of this case on the computer community at large. I'll
especially focus on how to make sure this doesn't happen to *you*.
-- Randal Schwartz
----------------------------------------------------------------------
The auditorium holds about 300 bodies, so we should have plenty of
room. Come one, come all. The talk is being presented by Boston Perl
Mongers; see the web page for details and updates. Direct questions
to the Boston.pm mailing list or to me.
Boston Perl Mongers: http://boston.pm.org/
Randal Schwartz: http://www.stonehenge.com/merlyn/
Friends of Randal Schwartz: http://www.lightlink.com/fors/
Jeffrey Kegler's Oregon v. Schwartz: http://www.rahul.net/jeffrey/ovs/
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: 03 Apr 1998 18:07:26 +0100
From: James Gillespie <jim.gillespie@ssmb.com>
Subject: RANT: All hail Perl!
Message-Id: <biibtuin8a9.fsf@ssmb.com>
Sorry everyone, but I've spent today wrestling with C++ after
months of Perl and *spit* SQL programming. What a pain! It's truly
painful to go through all the rigmarole necessary to do seemingly
simple things, and after enormous difficulty getting a project to
compile, the bit which I changed (and tested!) yesterday no longer
works! Trying to reproduce the error in a separate program gives me A
COMPLETELY DIFFERENT ERROR! Aaaaaargh! Please let me go back to Perl
programming, where at least if all else fails the debugger is
relatively simple to use (and doesn't take up SIX TIMES as much memory
as XEmacs - words fail me).
Phew, that's better.
Jim
PS - Dave Cross: I haven't forgotten, but my mail to you bounced
--
Jim.Gillespie@ ,'_ I always pack better when I'm pissed,
USA.net / -.--. ___ and Gatwick always seems nicer when
+44 171 721 2672 _\_x \__`--'_,-' you've got a hangover
/ /\\ \--'_-\\ -- Chris Paine
'94 Super III \__/ `---' \__/
------------------------------
Date: Thu, 02 Apr 1998 13:24:17 GMT
From: BGlicker@burrelles.com (Bill Glicker)
Subject: Redirecting STDOUT,STDER more than once
Message-Id: <35239135.420888275@208.159.24.50>
The following program is a condensation of what I'm doing in a much
larger script. STDOUT & STDERR are redirected to an output file for
most of the program, so that output from either the perl script or any
external system programs will go the same place.
However, somewhere in the middle of all this I want to capture the
output from external programs & perl to a command pipe, without
closing the previously opened filehandle.
Here's what I've come up with. It works, but I'd appreciate any
comments or criticism as to incorrect usage or inefficiencies.
Thanks
Bill
#!/usr/local/bin/perl
#
# Redirection of standard out in a subroutine, after it's already
# been redirected.
# Necessary to capture output of externally called programs.
use IO::File;
use strict;
# Here are the variables for the first redirection of STDOUT/STDERR
my($fh);
my($SAVEOUT) = new IO::File;
my($SAVEERR) = new IO::File;
my($FIRSTFILE) = new IO::File;
my($FirstFile) = "/u1/tmp/first.out";
unless ( open ($FIRSTFILE, ">$FirstFile") )
{
die "Couldn' open $FirstFile for writing.";
}
# First redirection
$fh = fileno($FIRSTFILE);
open($SAVEOUT,">&STDOUT");
open($SAVEERR,">&STDERR");
open(STDOUT, ">&$fh") || die "Can't redirect stdout";
open(STDERR, ">&$fh") || die "Can't redirct stderr";
# Flush output as soon as it happens
select((select(STDOUT), $| = 2)[0]);
select((select(STDERR), $| = 2)[0]);
print STDOUT "This is the first line to the first STDOUT file\n";
print STDERR "This is the first line to the first STDERR file\n";
&NewOutput();
print STDOUT "This is the third line to the first STDOUT file\n";
print STDERR "This is the third line to the first STDERR file\n";
exit 0;
####################################################
sub NewOutput
####################################################
{
my($newfh);
my($SECONDFILE) = new IO::File;
my($OLDOUT) = new IO::File;
my($OLDERR) = new IO::File;
# Open to a pipe, since that's what the real program will do
unless ( open ($SECONDFILE, "| mailx -s 'Redirected Output' billg") )
{
die "Could not open the mail pipe for writing.";
}
$newfh = fileno($SECONDFILE);
open(STDOUT, ">&$newfh") || die "Can't redirect stdout";
open(STDERR, ">&$newfh") || die "Can't redirct stderr";
open($OLDOUT, ">&$fh") || die "Can't open original stdout for output";
open($OLDERR, ">&$fh") || die "Can't open original stdout for output";
# Flush output as soon as it happens
select((select(STDOUT), $| = 2)[0]);
select((select(STDERR), $| = 2)[0]);
print $OLDOUT "This is the second line to the first STDOUT file\n";
print STDOUT "This is the first line to the second STDOUT file\n";
print STDERR "This is the first line to the second STDERR file\n";
print $OLDERR "This is the second line to the first STDERR file\n";
close ($OLDOUT);
close ($OLDERR);
open(STDOUT, ">&$fh") || die "Can't redirect stdout";
open(STDERR, ">&$fh") || die "Can't redirct stderr";
}
------------------------------
Date: Fri, 3 Apr 1998 19:58:10 +0100
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <Glha9EACFTJ1Ew3+@connected.demon.co.uk>
In <comp.lang.perl.misc>
John Porter <jdporter@min.net>, writes:
>John Stanley wrote:
<sliced. spam-talk>
Very O.T. for c.l.p.m. but probably of interest to anyone who's filters
have not been T.C. tuned.
Take a peek at the following in Deja:
Message-ID: <980332153824.AA@ferret.ocunix.on.ca>
Date: 31 Mar 1998 21:19:24 EST
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Subject: ANNOUNCEMENT: Spam Cancel Moratorium
It's going to get *very* busy. :-(
--
Jerry Pank mailto:jerryp.usenet@connected.demon.co.uk
It's possible that I'm just an idiot, and don't recognize a sleepy
slavemaster when I see one.
-- Larry Wall in <199708040319.UAA16213@wall.org>
------------------------------
Date: Fri, 3 Apr 1998 15:03:03 -0500
From: Brian <brian@structure.student.umd.edu>
Subject: structs
Message-Id: <Pine.LNX.3.95.980403150117.27893A-100000@structure.student.umd.edu>
How does one represent structs in perl?
I heard there's some way to do it.
-Brian
------------------------------
Date: 3 Apr 1998 15:27:45 -0500
From: allen@gateway.grumman.com (John L. Allen)
Subject: Re: The "Y2k-bugs-are-not-just-a-legacy-problem" FAQ
Message-Id: <6g3go1$a19@gateway.grumman.com>
In article <35223271.61604E90@dgb.nl>, Bert Bril <bert@dgb.nl> wrote:
>Daniel P. B. Smith wrote:
>> It was recently pointed out to me that "one furlong per fortnight"
>> is almost exactly 1 centimeter per minute. How's that for useful?
>
>Is there something wrong here? Is a furlong 201.6 m?
>Or should it be '1 centimeter per hour'?
>In which case a furlong is a more comprehensible 3.36 m.
No. 1 centimeter per minute it is.
Particularly useful for this stuff
is the unix units command:
$ units
you have: furlongs/fortnight
you want: centimeters/minute
* 9.978571e-01
/ 1.002147e+00
Pretty neat.
John.
--
_/JohnL\_allen@gateway.grumman.com <Sun>: 9.5 billion pounds per sec to energy
~\Allen/~Fax: 516-575-7428 <Universe>: 1e22 stars = 22 solar masses per sec
------------------------------
Date: 3 Apr 1998 13:30:39 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Tie/bless vs. bless/tie and segmentation fault
Message-Id: <6g3dcv$5pe@fohnix.metronet.com>
You are making circular references so these are destroyed only
during global destruction and you can't predict the order in
which it will happen. If a tied object is destroyed before the
Foo object that references that tied hash, then Foo::DESTROY
will try to untie a hash from an object that has already been
destroyed.
lehman@javanet.com writes:
) sub DESTROY
) {
) my ($self) = @_;
) untie %$self;
) }
Change that to
untie %$self if tied(%$self);
and the core dump disappears and the depth of your problem
becomes more apparent:
untie attempted while 1 inner references still exist during global destruction.
Use of uninitialized value during global destruction.
...
You need to remove the hard reference back to the first object
so that it will be destroyed when it goes out of scope. With
Perl 5.004, I don't immediately see a solution if you really
need the back reference. Perl 5.005 is rumored to support weak
references which might be appropriate here.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 2243
**************************************