[8153] in Perl-Users-Digest
Perl-Users Digest, Issue: 1771 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 30 14:07:16 1998
Date: Fri, 30 Jan 98 11:00:24 -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, 30 Jan 1998 Volume: 8 Number: 1771
Today's topics:
Re: 5 REAL languages (was: Re: AOL SPAM) (Chip Salzenberg)
Re: Another "uninitialized variable" problem (Greg Andrews)
Behavior of NaN and Infinity are system dependent <steve.tolkin@fmr.com>
Re: Can PERL test for a process? (Michael J Gebis)
Re: Check Variable type (Chip Salzenberg)
Re: Don't use signal handlers (was Re: Child processes) <Jacqui.Caren@ig.co.uk>
Re: Don't use signal handlers (was Re: Child processes) (Chip Salzenberg)
Re: Don't use signal handlers (was Re: Child processes) (Chip Salzenberg)
Re: Enlightenment: regexes: fun with /x (Ilya Zakharevich)
Error executing Perl script <hvanlint@lodestar.be>
Re: HELP REQUEST: Is there a better way the change my ( <rootbeer@teleport.com>
Re: Insecure Path <rootbeer@teleport.com>
Re: Internet Community needs cgi scripts like it needs (Chip Salzenberg)
Re: loading page after cgi call causes path problems. (Chip Salzenberg)
Re: Matching one line, then another (Craig Berry)
perl 5 compiler - Is there one? (paul Spitalny)
Re: Perl 5.0, IIS 4.0, and writing to files. (Chip Salzenberg)
Please help! <andrew@cubik.com>
Re: Please help! (Mike Stok)
Re: Printing in triplicate... <rootbeer@teleport.com>
Re: Profiler for Perl4 (yup. Perl4) <rootbeer@teleport.com>
Really Stupid Question (John Doen)
Re: Sending data to a printer?? (Chip Salzenberg)
Re: Sending mail from NT4.0 (Neil Briscoe)
Re: Sending mail from NT4.0 <dpk@brainiac.egr.msu.edu>
Re: Text Problems With Explorer 4.0 (Chip Salzenberg)
Re: Web based perl script with SCCS commands (Chip Salzenberg)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 30 Jan 1998 18:10:44 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: 5 REAL languages (was: Re: AOL SPAM)
Message-Id: <6at56i$b3f$1@cyprus.atlantic.net>
According to jdporter@min.net:
> Trac
TRAC! I'm not the only person who remembers that?
Once I wrote a TRAC interpreter. It was like a dancing bear: The point
wasn't that danced well, but that it danced at all. It was lots of fun
and of absolutely no practical utility.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: 30 Jan 1998 18:26:19 GMT
From: gerg@shell. (Greg Andrews)
Subject: Re: Another "uninitialized variable" problem
Message-Id: <6at60b$sd5$2@news.ncal.verio.com>
ged@fortec.tuwien.ac.at writes:
>
>i tried the following for quick and dirty testing:
>
>$fence_bits="00000";
>print $fence_bits."\n";
>$fence_bits = ($fence_bits | "10000");
>print $fence_bits."\n";
>
>and the output is:
>
>00000
>Use of unitialized value at test.pl line 3.
>10000
>
>so $fence_bits is initialized and in the next line uninitialized???
>
It's the quotes around 10000, probably interacting with the
parentheses.
If you change the above to:
$fence_bits="00000";
print $fence_bits."\n";
$fence_bits |= "10000";
print $fence_bits."\n";
or
$fence_bits=00000;
print $fence_bits."\n";
$fence_bits = ($fence_bits | 10000);
print $fence_bits."\n";
You don't get the error anymore.
I'm not enough of a perl guru to explain what triggers the error
message, though.
-Greg
------------------------------
Date: Fri, 30 Jan 1998 13:02:32 -0500
From: Steven Tolkin <steve.tolkin@fmr.com>
To: steve.tolkin@fmr.com
Subject: Behavior of NaN and Infinity are system dependent
Message-Id: <34D215B7.170E3E43@fmr.com>
I was hoping to use the IEEE special value NaN (Not a Number) in the
same role as NULL in a SQL database, because it matches no other value,
not even itself. This works on my Unix system (Solaris) but not on my
PC. So I have several questions and suggestions:
1. Is this documented anywhere in the Perl doc set? I think it should
be, at least in the
"traps" section. Is there a section on non-portable constructs?
2. Is there any hope that Perl could provide a layer to get the
identical semantics on all platforms?
3. Is it a doc bug that man atof does not discuss the behavior I see
with Infinity, or is perl partly responsible? If someone has a little C
program to exercise atof I'd appreciate it. Are there any other special
values?
Foir details run my testnan.pl, provided here:
#!/usr/local/bin/perl -w
# $Id: testnan.pl,v 1.6 1998/01/30 17:33:26 sy71046 Exp $
# Written by Steven Tolkin
# This file shows that perl recognize Nan and Infinity,
# at least on my Unix system. But it does not on my PC.
# So presumably this is handled by the low level library
# that converts strings to numbers, e.g. atof or strtol etc..
# Is this behavior documented?
# Can it be relied upon not to change?
# I woul dactually prefer consistent behavior across platforms, i.e.
# for NaN to work everywhere, soi that I could use it to emulate
# NULL in SQL database.
# Why are all prefixes of "infinity" of at least length 3 accepted
# and why does case not matter? Is this in agreement with some IEEE
# standard? Or a side effect of e.g. atof ignoring case and leading
# and trailing whitespace.
# My man atof says it ignores a leading "optional string of
``white-space''
# characters" but says nothing about trailing space. Similarly
# it says "If nptr is NaN, then atof() returns NaN." but
# does not mention case insensitivity. Nor does it mention Infinity at
all,
# let alone that the string "infi" will become Infinity!
# To test this interactively just type at the shell's prompt:
# perl -ne '($a,$b)= split; print $a+$b, "\n";
# and then type two values, e.g. 0 infi followed by a return, etc.
$nan = " naN "; # case and blanks are ignored ?!
$other = "nnn"; # Any string other than nan or ininity goes to 0
$infi = "infi"; # Even this 4 character string is enough to become
Infinity
# Show the values we loop through below
for $outer (1, $nan, $other, $infi)
{
$n = 0+$outer ;
print "string: '",$outer,"' numeric: $n\n";
}
# Show the results of addition and division
# Perhaps inf/inf should be NaN, but we get instead the error message
# Illegal division by 0.
# also note that NaN is not <, ==, or > Nan -- so it behaves like
# NULL in SQL databases.
for $outer (1, $nan, $other, $infi)
{
for $inner (1, $nan, $other, $infi)
{
$s = "$outer+$inner=";
$sum = $outer+$inner;
print "$s $sum\n";
if ($inner < $outer) {print "$inner < $outer\n";}
elsif ($inner == $outer) {print "$inner == $outer\n";}
elsif ($inner > $outer) {print "$inner > $outer\n";}
else {print "$inner not < == nor > $outer!\n";}
}
}
exit 0
--
Steven Tolkin steve.tolkin@fmr.com 617-563-0516
Fidelity Investments 82 Devonshire St. R27C Boston MA 02109
There is nothing so practical as a good theory. Remarks are mine.
------------------------------
Date: 30 Jan 1998 17:49:22 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Can PERL test for a process?
Message-Id: <6at3r2$8mv@mozo.cc.purdue.edu>
Shaun Ledford <shaun@ms.com> writes:
}Trying to write a script that will test whether a process exists.
man perlipc
Search for "Another interesting signal to send is signal number zero"
Executive summary: You want to be using "if(kill 0,$pid)"
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Fri, 30 Jan 1998 18:38:54 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Check Variable type
Message-Id: <6at6rd$b8e$1@cyprus.atlantic.net>
According to Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>:
>so you won't sell me 1e2 beer even if I promise not
>to drive? :-)
Judicious use of 0+$input and local $^W and local $SIG{__WARN__}
should provide a subroutine that precisely reports if a string looks
like a number.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Fri, 30 Jan 1998 17:23:54 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <EnLxnv.9BF@ig.co.uk>
In article <6aq7jp$80d$1@cyprus.atlantic.net>,
Chip Salzenberg <chip@pobox.com> wrote:
>According to joseph@5sigma.com:
>>I'm going to have to temper what I just said. It's pretty likely
>>that $SIG{CHLD} = sub { wait } is going to cause a problem if
>>your program is spawning and reaping children at a good clip
>>for a period of time.
>
>That's not strong enough.
>
>Any given signal resulting in a signal handler being executed can
^
is there a missing "perl" here? Or is perl in C broken as well?
>kill your Perl, or worse, make it sick.
>
>Don't use Perl signal handlers. Ever.
This infers that perl is not a language fit for commercial use. Given
the significant effort made by many of us to try and convince various
people that perl is reliable and stable this sort of statement puts
perl back as into the toy language category.
Jacqui
--
Jacqui Caren Email: Jacqui.Caren@ig.co.uk
Paul Ingram Group Fax: +44 1483 419 419
140A High Street Phone: +44 1483 424 424
Godalming GU7 1AB United Kingdom
------------------------------
Date: Fri, 30 Jan 1998 18:29:50 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6at69f$b6p$1@cyprus.atlantic.net>
According to tchrist@mox.perl.com (Tom Christiansen):
>In comp.lang.perl.misc, chip@pobox.com writes:
>:Don't use Perl signal handlers. Ever.
>
>Now, kindly explain to the innocent bystanders
>when, where, and why that position is untenable.
Never. I'm quite serious.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Fri, 30 Jan 1998 18:36:06 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6at6m8$b7n$1@cyprus.atlantic.net>
According to Jacqui Caren <Jacqui.Caren@ig.co.uk>:
>Chip Salzenberg <chip@pobox.com> wrote:
>>Don't use Perl signal handlers. Ever.
>
>This infers that perl is not a language fit for commercial use.
You are very badly mistaken.
First, there is a huge range of applications that real businesses
want and need that don't need signal handlers.
Second, for applications that need signal handlers, it is entirely
safe to write an extension (a standard procedure for Perl coding) that
includes a signal handler written in C.
In the immortal words of The Hitchhiker's Guide: "Don't Panic".
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: 30 Jan 1998 17:51:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Enlightenment: regexes: fun with /x
Message-Id: <6at3us$75t$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Chipmunk
<rjk@coos.dartmouth.edu>],
who wrote in article <34D160DE.2C75D525@coos.dartmouth.edu>:
> Rx is a regex with whitespace and/or comments.
> R is Rx with the comments and embedded whitespace removed.
> Find a useful Rx such that /Rx/x works, but /R/ does not.
>
> Answer:
> Rx = '^\w*$ (?!\n)'
> This regex can be used to determine if the target string consists
> entirely of word-characters.
As I said in a different message, /R/ will *just* work with newer Perls.
> As an aside, this will also work:
> /^\w*\Z(?!\n)/
With older Perls you can use zillions of others methods, like
/^\w*(?!\n)$/
m'^\w*$(?!\n)';
$dollar = '$'; /^\w*$dollar(?!\n)/
and so on and so on and so on...
Ilya
------------------------------
Date: Fri, 30 Jan 1998 18:52:51 +0100
From: "Hans Van Lint" <hvanlint@lodestar.be>
Subject: Error executing Perl script
Message-Id: <6at401$lb7$1@news2.xs4all.nl>
Hi,
I made a script file for a customer and put it online on our provider's
server and it worked fine.
Our customer has put it online on his provider's server and when they try to
execute the script from there they get the following error:
ExecCGI Error : No valid exec mapping found.
Does anyone know what this error means and how it can be fixed??
Thanks
------------------------------
Date: Fri, 30 Jan 1998 10:15:27 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: acw <andre_womble@hp.com>
Subject: Re: HELP REQUEST: Is there a better way the change my (and child processes) environment?
Message-Id: <Pine.GSO.3.96.980130100108.1584Q-100000@user1.teleport.com>
On Thu, 29 Jan 1998, acw wrote:
> %ENV=split(/[=\n]/,`. ./local_env ; env`);
>
> OR,
>
> %ENV=eval {
> split(/[=\n]/,`. ./local_env ; env`)
> };
>
> What is the better way?
The first, since the second one can't really trap any errors. That is,
errors within the backticks aren't captured by eval{}, and the split can
work on anything that the backticks return.
Of course, there may be a better way yet to do what you need. :-) (For
example, I'd consider that an environment variable - such as TERMCAP, for
example - may itself contain an equals sign and may span several lines.)
I'd consider using this in place of env...
perl -e 'print map "$_=".unpack("H*",$ENV{$_})."\n", keys %ENV'
But building the "other end" of this program is left as an exercise. :-)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 30 Jan 1998 10:26:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Insecure Path
Message-Id: <Pine.GSO.3.96.980130102532.1584S-100000@user1.teleport.com>
On Thu, 29 Jan 1998, Dave Barnett wrote:
> $ENV{PATH} = ""; # unset the existing path
> $ENV{PATH} = "/bin:/usr/bin" # reset the path to a known "good"
> path...edit as you see fit
Of course, you can omit the first step if you're going to do the second.
:-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 30 Jan 1998 18:47:21 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Internet Community needs cgi scripts like it needs ...
Message-Id: <6at7b5$b9r$1@cyprus.atlantic.net>
According to pudge@pobox.com (Chris Nandor):
>... a hole in the head ...
>... AlterNIC ...
>... spammers ...
... IRC bots ... (except purl!)
... broadcast ICMP replies ...
... old sendmails ...
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Fri, 30 Jan 1998 17:47:48 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: loading page after cgi call causes path problems.
Message-Id: <6at3rm$b03$1@cyprus.atlantic.net>
You want comp.infosystems.www.authoring.cgi: just down the hall,
turn left at the sound of information clamoring to be valuable.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: 30 Jan 1998 17:53:30 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Matching one line, then another
Message-Id: <6at42q$cki$1@marina.cinenet.net>
Bill Weaver (bill.weaver@lexis-nexis.com) wrote:
: There are two SQL output files that I would like to scan for successful
: operations and for errors. (The most common error is attempting adding
: duplicate ids.) The output files are of slightly different formats, and I
: have a perl solution for each, but I think my way is ugly and sophomoric.
: Can someone please suggest some better ways to do this?
:
: Basically, I'm looking for ids that succeed and ids that fail. In the sample
: data at the end of this message, the failed userid is ABC1230 (with a "1"
: tacked on by SQL), the successful adds are ids ABC1234, and ABC1236.
:
: #! /usr/local/bin/perl5
You forgot the -w switch.
: while (<>) {
: chop;
chomp is often preferable, though it's a minor difference.
: if (/^ 0/) {
The regex might be better written as /^ {11}0/ since multiple
spaces are hard to type/read accurately.
: while (<>) {
: if (/^\t([^\s]+)\s+$/) {
[^\s] can be equivalently and more compactly written as \S.
: $last_good_id = $1;
: print "$last_good_id added successfully\n";
: }
: last;
: }
: next;
Why put the while loop in, if you're going to unconditionally
exit after reading one line via 'last'? Why use 'next' to
trigger the next cycle, when you can use 'elsif' below and
get the same effect more clearly and with equal efficiency?
: }
: if (/duplicate USERID/) {
Make this 'elsif'.
: while (<>) {
: if (/^\t([^\s]+)\s+$/) {
See \S comment above.
: $failed_id = $1;
: print "$failed_id failed\n";
: last;
: }
This makes me think you've misplaced your 'last' in the
similar loop above.
: }
: next;
: }
: }
HTH!
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Fri, 30 Jan 1998 10:34:30 GMT
From: pauls@seanet.com (paul Spitalny)
Subject: perl 5 compiler - Is there one?
Message-Id: <pauls.5.4792ACE8@seanet.com>
Keywords: perl, perl5,compiler
Has anyone come across a perl compiler? I need my code to run faster but don't
want to have to go to C or C++. Any tips on where I can find a perl compiler
to run on my windows95 system??
Thanks
Paul
------------------------------
Date: Fri, 30 Jan 1998 18:02:30 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Perl 5.0, IIS 4.0, and writing to files.
Message-Id: <6at4mg$b2b$1@cyprus.atlantic.net>
According to Jason Vallery <vallery@bvsd.k12.co.us>:
>I have had great sucess thanks to the help of everyone on this group
>actually getting Perl up and running with IIS. Now my probably is taking
>an existing program and getting it to work on NT from Unix. I have user
>perl for a while now and am rather familiar with it.. The NT thing has me
>confused. When I try to open a file and print to it everything appears to
>go well, but the files is empty..
>I have tried this
>
>open(FILE,"temp.txt");
>print FILE "This is a file test\n";
perldoc open. You forgot the ">". Worse, you didn't check the return
value of open and the value of $!.
>sub print {
> if (! open(LOG,">>$logfile")) {
> print "Can't open the file\n";
> exit;
> }
> print LOG "blah blah blah\n";
> close (LOG);
> }
Defining subs named the same as built-in operators is often a
mistake. That's probably what's getting you.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Fri, 30 Jan 1998 09:47:19 -0800
From: Andrew Chandler <andrew@cubik.com>
Subject: Please help!
Message-Id: <34D21227.53D6@cubik.com>
I'm working on an NT server. I'm running a script that calculates
a 25% discount, and the value invariably contains more than 2 decimal
places--how can I round this number to 2 decimals, or is there a library
I can use? Thanks!!
------------------------------
Date: 30 Jan 1998 13:09:05 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Please help!
Message-Id: <6at501$1le$1@stok.co.uk>
In article <34D21227.53D6@cubik.com>,
Andrew Chandler <andrew@cubik.com> wrote:
>I'm working on an NT server. I'm running a script that calculates
>a 25% discount, and the value invariably contains more than 2 decimal
>places--how can I round this number to 2 decimals, or is there a library
>I can use? Thanks!!
You can use printf or sprintf (depending on whether you're printing it out
or formatting it and stashing it in another variable). These functions
get their names from C library routines, and the perl versions are
documented in the perlfunc manual page.
In recent perls the FAQ is included in the documentation that's installed
as standard, so
perldoc perlfaq
will get you the list of FAQ parts, and perlfaq4 includes:
Does perl have a round function? What about ceil() and
floor()? Trig functions?
For rounding to a certain number of digits, sprintf() or
printf() is usually the easiest route.
The POSIX module (part of the standard perl distribution)
implements ceil(), floor(), and a number of other
mathematical and trigonometric functions.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 30 Jan 1998 10:22:45 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Franklin L. Petersen" <orangutan@grungyape.com>
Subject: Re: Printing in triplicate...
Message-Id: <Pine.GSO.3.96.980130101935.1584R-100000@user1.teleport.com>
On Thu, 29 Jan 1998, Franklin L. Petersen wrote:
> Can someone tell me why this is printing my results to the screen in
> triplicate?
>
> (ie: 1234.gif 1234.gif 1234.gif)
> print "Content-type: text/html\n\n" ;
Well, it's not that line of code.
> print "<base target=\"body\">\n";
I don't think it's that one.
> print "<a
> href=\"/drawing/eng/$dwgs/$num1/$num2/$graphic\">$graphic</a>\n";
Unless you mean that it's printing "1234.gif 1234.gif 1234.gif" in the
middle of something else, it doesn't seem to be this one.
> print "<body bgcolor=white>\n";
Not there.
> print "<center><h2>I'm sorry, there was no matching part number
> found</h2></center>\n";
No, not there either.
Those were all of the print statements I saw in the code you posted. Did I
miss something?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 30 Jan 1998 10:43:02 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brendan Macmillan <bren@fangorn.cs.monash.edu.au>
Subject: Re: Profiler for Perl4 (yup. Perl4)
Message-Id: <Pine.GSO.3.96.980130103119.1584T-100000@user1.teleport.com>
On 29 Jan 1998, Brendan Macmillan wrote:
> Pretty funny, heh? Not sarcastic, right? Informative? Is the original
> poster already aware of Perl5? Check the subject line. Read carefully.
Oddly, you seem to be quite offended at what I wrote, even though the
original poster seemed glad to get my reply. Maybe it didn't seem so
sarcastic to him as it did to you. As I said before, I didn't and don't
intend any sarcasm, although I have no doubt that you're perceiving some
in everything I've written.
> But perhaps it is unfair to single you out, as your attitude is so
> typical.
I'm always interested in improving my abilities to reply to people's
questions. As I've asked you before, do you have a better answer to the
original question?
> I've said this far too many times now. Honestly, if you can't see
> what I'm talking about there is no point in emailing me personally
> with further replies.
You're probably right that there's no point; if everything I write is seen
by you as sarcastic and mean, it'll be difficult for us to successfully
communicate. If what I'm writing now still seems sarcastic to you, I
propose that we break it off here, with no hard feelings on my part. I'd
like to thank you for your attempt to improve my answers, in any case.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 30 Jan 1998 17:26:45 GMT
From: tmagnum@coredcs.com-nospam (John Doen)
Subject: Really Stupid Question
Message-Id: <34d20c84.519205385@snews2.zippo.com>
Hello,
I'm working on a form where the user submits info a perl script
processes their choice and outputs the appropriate page. Easy right?
Yes it should be. I'm having problems getting the script, contacted
below, to get through the If statement. When I run it in debug mode I
get a "Use of Uninitialzed Variable" error on the line with the If
statement.
However if I comment out the If statement(and brackets) the script
runs fine and outputs a page.
I'm hoping that someone can shed some light on why I'm so stupid.
Thanks!
#!/usr/bin/perl -w
$| = 1;
print "Content-type: text/html\n\n";
require "/usr/apache/cgi-bin/cgi-lib.pl";
&ReadParse(*form_data);
$FrontChoice = $form_data{'choice'};
if ($FrontChoice eq "techhelp")
{
&PrintStuff;
exit;
}
# *****Subroutine PrintStuff*****
sub PrintStuff
{
print <<__HTML__;
<html><head><title>Page</title>
</head>
<body bgcolor = "FFFFFF" text = "000000">
Test web page.</p>
$FrontChoice
</body></html>
__HTML__
} # **END Sub PrintStuff**
------------------------------
Date: Fri, 30 Jan 1998 18:48:08 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Sending data to a printer??
Message-Id: <6at7cq$bag$1@cyprus.atlantic.net>
According to Hinrich Specht <hspecht@bytes.de>:
>(Maybe it's a stupid question but I haven4t got the time to learn pearl
>at the moment....)
comp.lang.perl.misc helps those who help themselves.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: 30 Jan 1998 18:47:57 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Sending mail from NT4.0
Message-Id: <memo.19980130184756.64371A@skep.compulink.co.uk.cix.co.uk>
In article <34D19C37.34D497ED@oslo.geco-prakla.slb.com>,
lyshaugl@oslo.geco-prakla.slb.com (Lars Lyshaug) wrote:
> All,
>
> I've never done any programming in Perl, but a collegue made me believe
> that it would cover my needs anyway.
>
> I have a NT 4.0 domain controller. Here, I run misc. (CMD)scripts for
> logging disk use, etc, etc..
> I need to find a way to 'pipe' the content of my logfiles automatically
> to a pre-defined mail recipient.
> Perl5 is installed on the server. IIS is NOT installed on the server,
> nor is Microsoft Outlook. Office95 is, though.
>
> Maybe Perl isn't what I'm looking for, but it's worth a try. I would
> like to learn enough about it to make small scripts that the MS Command
> Shell isn't able to do for me. Thanks.
>
So long as you have an SMTP server that you can connect to, then I have a
Perl library that you can use under NT4.
Its based (loosely ;-)) on the Net::SMTP module by Graham Barr - but as I
could never get the module to work under NT I hacked this together
instead.
If you send me an Email I'll send you a zip containing the library and a
sample script that will show you how to use it.
Regards
Neil
------------------------------
Date: 30 Jan 1998 18:42:19 GMT
From: Dpk <dpk@brainiac.egr.msu.edu>
Subject: Re: Sending mail from NT4.0
Message-Id: <6at6ub$s76$1@msunews.cl.msu.edu>
Lars Lyshaug <lyshaugl@oslo.geco-prakla.slb.com> wrote:
: All,
: I've never done any programming in Perl, but a collegue made me believe
: that it would cover my needs anyway.
: I have a NT 4.0 domain controller. Here, I run misc. (CMD)scripts for
: logging disk use, etc, etc..
: I need to find a way to 'pipe' the content of my logfiles automatically
: to a pre-defined mail recipient.
: Perl5 is installed on the server. IIS is NOT installed on the server,
: nor is Microsoft Outlook. Office95 is, though.
: Maybe Perl isn't what I'm looking for, but it's worth a try. I would
: like to learn enough about it to make small scripts that the MS Command
: Shell isn't able to do for me. Thanks.
: Best regards, Lars.
I have never used perl on a Wintel platform, so I don't really know
it's functionality... *but* you should be able to open a socket
to your mailserver, sending the sendmail commands and data, etc.
I would check perl.com as there is a module for this. I don't know
if it has been ported to NT however.
Dennis
--
dpk <dpk@egr.msu.edu>, Network Administrator | work: 353.4844
Division of Engineering Computing Services | page: 222.5875
------------------------------
Date: Fri, 30 Jan 1998 18:45:13 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Text Problems With Explorer 4.0
Message-Id: <6at772$b98$1@cyprus.atlantic.net>
According to webmaster@builderpress.com:
>submitting to my cgi forms were having problems with their data being
You want comp.infosystems.www.authoring.cgi, just down the hall and
turn left at the sound of the camas.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
Date: Fri, 30 Jan 1998 17:51:27 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Web based perl script with SCCS commands
Message-Id: <6at42h$b10$1@cyprus.atlantic.net>
You're looking for comp.infosystems.www.authoring.cgi, just down the
hall, turn left at the sound of M$ Infernet Exploiter crashing.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
Like Perl? Want to help out? The Perl Institute: www.perl.org
-> Ask me about Perl training and consulting <-
"It's the lemon zester of death!!" // MST3K
------------------------------
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 1771
**************************************