[9022] in Perl-Users-Digest
Perl-Users Digest, Issue: 2639 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 19 13:10:41 1998
Date: Tue, 19 May 98 10:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 19 May 1998 Volume: 8 Number: 2639
Today's topics:
"Out of Memory!" on DecAlpha/WinNT/IIS3 <raymond@terraincognita.com>
Can Perl call k shell scripts? IoanJ@my-dejanews.com
Can't call method "Worksheets" without a package or obj Brett.A.Hunsaker@usace.army.mil
Re: can't find uninitialized value after while block, c <suthsc@ncs.com>
Re: COM and CPAN (actually, a semi-rant on survivable s <bruce_howells@i2.com>
Re: DBD:Oracle: Bad free() ignored during global destru renzhu.xu@cor.dowjones.com
Re: DBD:Oracle: Bad free() ignored during global destru (Todd Hivnor)
Re: Does Perl have a IDE?I don't like command line. (Brad Murray)
Re: Does Perl have a IDE?I don't like command line. (Mike Heins)
Email type gateway <toastboy@mindless.com>
HTTP/1.0 501 Not Supported <rickryan@mindspring.com>
Re: HTTP/1.0 501 Not Supported (Andrew Williams)
Re: HTTP/1.0 501 Not Supported (Nathan V. Patwardhan)
Re: HTTP/1.0 501 Not Supported (Chris Nandor)
Re: I need help using the system command <rickryan@mindspring.com>
Inter-process file arbitration? <jgoldberg@dial-but-dont-spam.pipex.com>
Re: Is this WEB-BASED mail script good? <aqumsieh@matrox.com>
Re: Is this WEB-BASED mail script good? <lyonsd@atl.hp.com>
Re: join two array (John Porter)
Re: join two array (John Porter)
Looking for a liitle help <andrewh@cityofgardens.com>
Re: New Math Modules <aqumsieh@matrox.com>
Re: New Math Modules (Craig Berry)
Re: Non-static private variables (Mark-Jason Dominus)
Re: Perl for Windows is important, and comments on COM (Stuart McDow)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 19 May 1998 11:30:14 -0500
From: Raymond Simmons <raymond@terraincognita.com>
Subject: "Out of Memory!" on DecAlpha/WinNT/IIS3
Message-Id: <3561B396.7EFC9156@terraincognita.com>
I'm having trouble getting a Perl CGI script to read a 2 meg text file
into an array. The script produces an "Out of memory!" error during the
following code segment:
open(LOGFILE,"$logfile");
@LINES = <LOGFILE>;
close(LOGFILE);
Here's the stats on the system the script is running on...
Platform: Dec Alpha
Operating System: WindowsNT
Web Server: Internet Information Server 3
This script works fine in a Unix/Apache environment. In fact it can
process a 10 meg file with no problem. Anybody got a clue as to why it
could be running out of memory in the DecAlpha/WindowsNT/IIS3
environment?
Thanks,
Raymond Simmons
Technical Consultant and Programming Specialist
Terra Incognita Interactive Media
www.terraincognita.com
------------------------------
Date: Tue, 19 May 1998 15:02:51 GMT
From: IoanJ@my-dejanews.com
Subject: Can Perl call k shell scripts?
Message-Id: <6js6ur$i4d$1@nnrp1.dejanews.com>
Hi,
I'm trying to write a Perl script that will call existing k shell scripts.
These k shell scripts prompt the user for input and display output to the
monitor. How can I redirect STDIN and STDOUT from the korn scripts to the
shell running my Perl script? It seems that the scripts are started in some
other shell, but I get no input or output from them, just a curser in the
shell running the Perl script. I can get the korn scripts to error out, and
the Perl script continues. How can I get the korn scripts to appear to run in
the same scell as the Perl script?
As a simple example, the Perl script does this:
#!/bin/perl -w
print "Do you want to use the korn script? <y|n> ";
chop( $input = <STDIN> );
if ( $input eq "y" ){
`korn`;
}
# korn shell script
echo "Do you want to display the letter k? <y|n>"
read input
echo "Here it is anyway: KKKKKKKKKKkkkkkkkkkkkkk"
If I try this, once the Perl script gets the input ($input) and calls the korn
script, I get no output from the korn script, but if I press any key it seems
that the korn script ends, and the Perl script terminates normally.
Any help is greatly appreciated! I can't find the answer anywhere, even
though it seems very elementary.
-Ioan
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 19 May 1998 16:01:11 GMT
From: Brett.A.Hunsaker@usace.army.mil
Subject: Can't call method "Worksheets" without a package or object reference
Message-Id: <6jsac7$p7o$1@nnrp1.dejanews.com>
This problem has appeared in several usenet postings, but I have yet to see a
resolution. Let's try again:
The environment:
ActiveState's Perl for Win32 build 316
Windows NT 4.0 SP3
Microsoft Excel for Windows 95
The following Perl code can be found at
http://www.activestate.com/reference/Perl/Perl-Win32/oleauto.html
use OLE;
$excel = CreateObject OLE 'Excel.Application'
or warn "Couldn't create new instance of Excel App!!";
$excel->Workbooks->Open( 'test.xls' );
$excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'foo';
$excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'bar';
$excel->Save(); $excel->Quit();
Attempting to execute this code results in the following error:
Can't call method "Worksheets" without a package or object reference at
duh.pl line 5.
I have tried this both with and without the Excel spreadsheet test.xls
existing in the current directory before running the script. Listing the
current processes on the system shows that Excel is successfully started.
Any help would be appreciated.
Thanks in advance!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 19 May 1998 10:20:31 -0500
From: Scott Sutherland <suthsc@ncs.com>
Subject: Re: can't find uninitialized value after while block, causing warning
Message-Id: <ulnryqocg.fsf@ncs.com>
mpeppler@mbay.net writes:
> In article <uu36n1hiw.fsf@ncs.com>,
>
> I didn't see the first message, but I think that doing:
>
> my $restype = 0;
>
Yep... That was the ticket... I was initializing $restype to undef,
but that wasn't solving the problem...
Thanks...
Scott
--
Scott Sutherland National Computer Systems
(319) 354-9200 Measurement Services Division
<mailto:sut92199@ncs.com> Iowa City, Ia
#include "standard-disclaimer.h"
------------------------------
Date: Tue, 19 May 1998 12:16:03 -0400
From: Bruce Howells <bruce_howells@i2.com>
Subject: Re: COM and CPAN (actually, a semi-rant on survivable software design)
Message-Id: <3561B043.2895E8DD@i2.com>
(yes, I know this can be fixed by playing with the path. Offered not as a
request for help, but as observation on how beautifully complex systems can get
hosed quite easily.)
Well... CPAN.pm doesn't work well on this NT machine. Why not? Because LWP
relies on a batch file, get.bat, in \perl\bin. Note that the other LWP batch
files (except for HEAD and POST) start, safely, with a LWP- prefix.
get is also the name of the executable for PVCS responsible for version control
checkouts - which means my two options are either a working LWP or a working
PVCS. PVCS wins, which means \perl\bin\get.bat is now \perl\bin\get.lwp, and LWP
- and thus CPAN - isn't an option on this machine.
Now, yes, this is fixable with a bit of digging through LWP code to find
everywhere it calls get and fix it; but so far the hassle of digging through CPAN
myself hasn't justified the reverse-engineering necessary.
Just a reminder that a little bit of fragile design can really effect a lot of
functionality.
-Bruce Howells, bruce_howells@i2.com
Stuart McDow wrote:
> Steven Tolkin <steve.tolkin@fmr.com> writes:
> >
> > P.S. CPAN cannot even be installed on Windows 95.
> > This is documented -- it says CPAN is for Unix only.
>
> I don't know about win0.95, but I've had a fair amount of success
> using CPAN.pm on NT machines. I've heard, but not actually tried,
> using CPAN.pm on NT is best if you've built the perl distribution from
> scratch.
>
> (Unfortunately, I can't remember right now what packages I've
> successfuly downloaded and built and which ones failed.)
>
> FYI. HTH.
>
> --
> Stuart McDow Applied Research Laboratories
> smcdow@arlut.utexas.edu The University of Texas at Austin
> "Look for beauty in roughness, unpolishedness"
------------------------------
Date: Tue, 19 May 1998 14:56:47 GMT
From: renzhu.xu@cor.dowjones.com
Subject: Re: DBD:Oracle: Bad free() ignored during global destruction
Message-Id: <6js6jf$heo$1@nnrp1.dejanews.com>
In article <6jq92u$258@shell2.shore.net>,
hivnor@shore.net (Todd Hivnor) wrote:
>
> I'm trying to connect to Oracle 7.3 via Perl on Solaris.
>
> Versions are: Perl 5.003, SunOS 5.5.1, Oracle WG73, DBI 0.84,
> DBD:Oracle 1.45.
>
> I always get the following error:
>
> Database handle destroyed without explicit disconnect.
> Bad free() ignored during global destruction.
>
> I searched the through old comp.lang.perl articles,
> and found several mentions of this error. It apparently
> has something to do with a malloc() bug in Oracle.
>
> But the messages weren't too helpful. Someone recommended:
>
> "With modern Perl's you can define the env var PERL_BADFREE to 0 to
> silence the warning",
>
> so I tried:
>
> $ENV{PERL_BADFREE} = 0;
>
> but this didn't help. They also recommended:
> "reconfigure to not use perl's malloc"
>
> I'm not sure how to do this, I'm guessing I'd need to
> recompile Perl with some flag or other. But in my
> case, my Perl is hosted at a commercial ISP, so it
> is non-trivial to get Perl recompiled.
>
> * Can I just ignore the warning? Simple queries seem to work fine.
> I'm worried that I'm somehow thrashing my memory.
>
> * Is there are way to fix this problem without recompiling Perl?
>
> * If I do need to recompile Perl, what is the process?
>
> * Is there some documentation somewhere, that I can point
> my ISP to, to document the problem and why it requires a
> recompile?
>
> Todd Hivnor
> hivnor . shore . net
>
>
...Database handle destroyed without explicit disconnect.
I got the same error last night by running the sample code, have you
explicitly $dbh->disconnect at the end of your code ?
Since I am not quite experienced on Perl stuff, I cannot quite figure
out your situation. But my working environment is almost the same like
yours, my one works fine today.
Feel free to contact !
Enjoy your querying ?
RENZHU XU
Dow Jones & Co.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 19 May 1998 12:40:51 -0400
From: hivnor@shore.net (Todd Hivnor)
Subject: Re: DBD:Oracle: Bad free() ignored during global destruction
Message-Id: <6jscmj$n7l@shell2.shore.net>
I added $dbh->disconnect; so I no longer get
"Database handle destroyed without explicit disconnect."
But I still get "Bad free() ignored during global destruction. "
-- Todd
------------------------------
Date: 19 May 1998 08:30:34 -0700
From: murrayb@vansel.alcatel.com (Brad Murray)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6js8iq$fj2@cadre2.vansel.alcatel.com>
It seems Clinton Pierce suggested...
>Because I can ship production software to plants and not incur the wrath
>of Ford Management if it's compiled under the Native C Compiler. If people
>die because the C-Compiler screwed up, it's hard to sue GNU--Sun
>Microsystems is another matter.
Really? For vital (read safety-critical) applications we write we have
whatever compiler we intend to use verified by a third party and certified.
We are then insured based on that verification and incur the legal risk
ourselves. We have never been able to get any compiler manufacturer (Sun
or otherwise) to supply evidence of certification of their compilers and
this take on the legal risk.
I suspect if you use the tactic you describe above you are both placing
undue faith in a commercial compiler, and risking a lawsuit that I doubt
very much you could win. GCC could be exposed to the certification
process as easilly as any other compiler and, if it passed, it would be
as viable for use in safety-critical environments.
--
Brad Murray "The fall of modern man will be preceded by the
Software Analyst de-evolution of communications to the days of
Alcatel Canada oral tradition." --Tom Christiansen paraphrased
------------------------------
Date: 19 May 1998 12:37:16 -0500
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <3561b53c.0@news.one.net>
Leslie Mikesell <les@MCS.COM> wrote:
> In article <6jq9p0$bh3$1@client3.news.psi.net>,
> Abigail <abigail@fnx.com> wrote:
>>++
>>++ Postgresql is a nice free nearly-complete (lacks HAVING and a
>>++ few other things) SQL database: http://www.postgresql.org. It
>>++ is actively supported and has a recently updated ODBC driver
>>++ that allows access from MS-windows.
>>
>>
>>That's a nice toy, but in a different league then sometimes is required.
>>Yes, I'm aware of all the nice free things. Some of them are wonderful.
>>I've nothing against free software, in fact, I'm pro-free software.
>>But just because Sybase and Postgresql are both RDBSs doesn't mean
>>one can replace the other.
> Where would you draw the line between trying Postgresql and going
> with Sybase/Oracle, etc.? The main problem I see is that Postgresql
> doesn't have a built-in way to log transactions to alternate media
> between backups or to replicate among multiple servers so you are
> only as reliable as your hardware. But, as long as we are talking about
> perl you can have the client log the important stuff.
PostgreSQL has major speed/scalability problems, in my opinion. It is more
than an order of magnitude slower than I would expect a database to be.
I like MySQL. Fast, free, support available, source available, and
getting better all of the time. It is moving nicely toward the point
where I would use it for mission-critical systems.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Just because something is 131 Willow Lane, Floor 2 | || _ \
obviously happening doesn't Oxford, OH 45056 | || |_) |
mean something obvious is <mikeh@minivend.com> |___| _ <
happening. --Larry Wall 513.523.7621 FAX 7501 |_| \_\
------------------------------
Date: Tue, 19 May 1998 12:21:56 -0400
From: "Toastboy" <toastboy@mindless.com>
Subject: Email type gateway
Message-Id: <6jsdh3$cch$1@news.bond.net>
I need to know if there is a script of some sort for an email reader/writer
out there. Preferably free. But will pay if needed.
Thanx
------------------------------
Date: Tue, 19 May 1998 10:17:24 -0500
From: "rickryan@ Mindspring" <rickryan@mindspring.com>
Subject: HTTP/1.0 501 Not Supported
Message-Id: <6js76e$9at$1@camel18.mindspring.com>
Please forgive me for this non-perl question.
What does this error mean on an NT server running IIS 3.0? I'm trying to
execute a system command when this happens.
HTTP/1.0 501 Not Supported
rickryan@mindspring.com
Many thanks to the gurus here.
------------------------------
Date: Tue, 19 May 1998 15:53:11 GMT
From: andrew@edoc.com (Andrew Williams)
Subject: Re: HTTP/1.0 501 Not Supported
Message-Id: <3561aaa8.695492906@news.clark.net>
On Tue, 19 May 1998 10:17:24 -0500, "rickryan@ Mindspring"
<rickryan@mindspring.com> wrote:
>Please forgive me for this non-perl question.
>
>What does this error mean on an NT server running IIS 3.0? I'm trying to
>execute a system command when this happens.
>
>HTTP/1.0 501 Not Supported
>
>rickryan@mindspring.com
>
>Many thanks to the gurus here.
it means whatever operation you were trying to preform is not
supported by the server. (or the server is not configured to support
the feature on the file you are requesting)
------------------------------
Date: 19 May 1998 16:08:04 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: HTTP/1.0 501 Not Supported
Message-Id: <6jsap4$i4j@fridge.shore.net>
rickryan@ Mindspring (rickryan@mindspring.com) wrote:
: Please forgive me for this non-perl question.
No, I won't.
--
Nathan V. Patwardhan
hmm. sounds like a job for root@localhost
------------------------------
Date: Tue, 19 May 1998 16:28:45 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: HTTP/1.0 501 Not Supported
Message-Id: <pudge-1905981223040001@dynamic10.ply.adelphia.net>
In article <6jsap4$i4j@fridge.shore.net>, nvp@shore.net (Nathan V.
Patwardhan) wrote:
# rickryan@ Mindspring (rickryan@mindspring.com) wrote:
# : Please forgive me for this non-perl question.
#
# No, I won't.
hoh ha ha heh hoo [MacPerl auto-laugh]
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
#=====================================================================
Coffee is not for kids.
--Bart Simpson
------------------------------
Date: Tue, 19 May 1998 10:13:02 -0500
From: "rickryan@ Mindspring" <rickryan@mindspring.com>
Subject: Re: I need help using the system command
Message-Id: <6js6u8$vse$1@camel18.mindspring.com>
I believe the correct syntax is:
system("command arg1 arg2");
Steve DeWitt wrote in message <35614426.B5635AB7@lynden.com>...
>The following script checks the printers and I am currently trying to
>get it to do other things. I am ok with the way it checks the printers.
>I need help using the system command or not using it. I cannot get the
>commands I want to execute to execute.
>
>##########################
>Steve DeWitt 5/98
>##########################
>#! /local/bin/perl
>require ("steved.lib");
>&GetSplitData;
>#this will get the data request from the web page
>if ($FORM{'R1'} eq "aml") {
> $printers = `lpstat -o aml -l`;
>} elsif ($FORM{'R1'} eq "laf") {
> $printers = `lpstat -o laf -l`;
>} elsif ($FORM{'R1'} eq "kent") {
> $printers = `lpstat -o kent -l`;
>} elsif ($FORM{'R1'} eq "gcom") {
> $printers = `lpstat -o gcom -l`;
>} elsif ($FORM{'R1'} eq "fuji") {
> $printers = `lpstat -o fuji -l`;
>} elsif ($FORM{'R1'} eq "ci1000") {
> $printers = `lpstat -o ci1000 -l`;
>} elsif ($FORM{'R1'} eq "all") {
> $printers = `chall`;
>} elsif ($FORM{'R1'} eq "dp") {
> $printers = `lpstat -o dp -l`;
>} elsif ($FORM{'R1'} eq "enable") {
> #the lines after this is where I have questions
> if ($FORM{'D3'} eq "disable")
> if ($FORM{'D2'} eq "laf") {
> system disable laf;
------------------------------
Date: Tue, 19 May 1998 16:16:46 +0100
From: "Jeremy Goldberg" <jgoldberg@dial-but-dont-spam.pipex.com>
Subject: Inter-process file arbitration?
Message-Id: <6js7qc$p67$1@plug.news.pipex.net>
Can anyone help me out here? I want to be able to read the contents of a
file, process, and then write out again, without the file being interfered
in the meantime by anything else... something like a filelock() fileunlock()
command. As it stands, there's been conflicts already, and in one case they
broke the program by reducing the data files to gibberish.
flock doesn't seem to be what I'm looking for. I think what I want is a
semaphore system (or something similar), but all the IPC/sysV stuff just
leaves me befuddled, quite apart from the lack of documentation on how to
use it and what systems it works on.
Something like this:
if( FileLock() ) # Will wait until file is free, rather than just
aborting straight away
{
ReadFile();
ProcessData();
WriteFile(); # We can be sure the data hasn't been written to
while we were changing it
FileUnlock();
}
So - can anyone suggest some good docs, show me some source, or just
recommend a module (ahem) that allows a file locking system that will block,
rather than just fail?
- Jeremy Goldberg
P.S. Does flock() only work AFTER you've opened a file?
------------------------------
Date: Tue, 19 May 1998 10:18:07 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Is this WEB-BASED mail script good?
Message-Id: <3561949F.6A687319@matrox.com>
Paul van der Pan wrote:
> I found this perl cgi-script for Web based email (should work on Linux) on
> the net,
> can somebody tell me if there are big security holes in this script?
>
> Paul
>
I will ... if you pay me $100/hr ;-)
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Tue, 19 May 1998 12:30:35 -0400
From: "David A. Lyons" <lyonsd@atl.hp.com>
Subject: Re: Is this WEB-BASED mail script good?
Message-Id: <3561B3AB.153FA99F@atl.hp.com>
Ala Qumsieh wrote:
>
> Paul van der Pan wrote:
>
> > I found this perl cgi-script for Web based email
> > (should work on Linux) on the net,
> > can somebody tell me if there are big security holes
> > in this script?
> >
>
> I will ... if you pay me $100/hr ;-)
Paul, don't let this guy rip you off! I'll do it for $90/hr! ;^)
Dave
------------------------------
Date: Tue, 19 May 1998 15:54:44 GMT
From: jdporter@min.net (John Porter)
Subject: Re: join two array
Message-Id: <MPG.fcb76cbdbf201259896d2@news.min.net>
On Tue, 19 May 1998 08:34:42 -0400,
in article <Pine.LNX.3.96.980519082314.5551I-100000@alborz.dac.neu.edu>,
natoofi@alborz.dac.neu.edu (natoofi@alborz.dac.neu.edu) wrote:
>
> I have two, two demensional array(@DataInArray,@DataOutArray)
> with the 2000 set of entery on the following format respectively:
> $Time $ODist $ODeltaYY $ODeltaX $ODeltaY
> $Time $IDist $IDeltaYY $IDeltaX $IDeltaY
I assume that means that each element in @DataInArray is actually an
array-ref created like so:
[ $Time, $ODist, $ODeltaYY, $ODeltaX, $ODeltaY ]
and likewise for @DataOutArray.
> I want to join them together and for one two demensional array with the
> following members
>
> ($Time, $ODist,$ODeltaX,$ODeltaY,$IDist,$IDeltaX,$IDeltaY)
>
> I guess we call it cross referencing them with $Time.
No problem. Try a hash:
my %table; # keyed by time. I assume times are unique!
for ( @DataOutArray ) {
# note that $_->[0] is the $Time value, and
# @$_ is the contents of the array referenced by $_.
# the push copies the contents.
push @{ $table{ $_->[0] } }, @$_;
}
for ( @DataInArray ) {
# do the exact same thing, except omit the time item:
push @{ $table{ $_->[0] } }, @{$_}[1,-1];
}
# now the values of the %table hash are array-refs containing
# what you said you wanted.
for my $time ( sort keys %table ) {
print "@{$_}\n";
}
hth,
John Porter
------------------------------
Date: Tue, 19 May 1998 16:02:18 GMT
From: jdporter@min.net (John Porter)
Subject: Re: join two array
Message-Id: <MPG.fcb789426fa045e9896d3@news.min.net>
On Tue, 19 May 1998 15:54:44 GMT,
in article <MPG.fcb76cbdbf201259896d2@news.min.net>,
jdporter@min.net (John Porter) wrote:
>
Whoops. Corrections:
> for ( @DataOutArray ) {
> # note that $_->[0] is the $Time value, and
> # @$_ is the contents of the array referenced by $_.
> # the push copies the contents.
> push @{ $table{ $_->[0] } }, @$_;
push @{ $table{ $_->[0] } }, @{$_}[0,1,3,4];
> }
>
> for ( @DataInArray ) {
> # do the exact same thing, except omit the time item:
> push @{ $table{ $_->[0] } }, @{$_}[1,-1];
push @{ $table{ $_->[0] } }, @{$_}[1,3,4];
> }
John Porter
------------------------------
Date: Sat, 16 May 1998 17:27:59 -0400
From: Andrew Harman <andrewh@cityofgardens.com>
Subject: Looking for a liitle help
Message-Id: <355E04DF.2513@cityofgardens.com>
I am trying to adapt a perl `Postcard' script to run under NT and IIS.
It works...however, at the point in the code where the emailed message
is piped to the sendmail equivalent I am using(Stalkers Mail.exe), it
wants to write a file to the local hard drive. If that file (same name
as the perl script) is saved, it shows all the output of the the mail
program as it sends the mail successfully and then the rest of the perl
script which is just the sub to write the HTML for the browser
confirming that the mail is sent and showing the user what the card
would look like. The HTML is only written to the file and does not show
up in the browser. Regardless of whether the file is saved or canceled,
the mail is sent and the HTML is not displayed.
Thinking it might be the mail.exe, I have tried other command line
mailers with similar results. That file asks to be written.
Any suggestions or assistance would be much appreciated.
Last to subs of the code
#*************************************************
sub send
{
$SENDMAIL='D:\\inetpub\\wwwroot\\cgi-bin\\mail.exe'; # This is the
location of the
# sendmail program
on your system
open (MAIL,"|$SENDMAIL $FORM{'mail'}");
print MAIL "Reply-to: $FORM{'replyto'}\n";
print MAIL "From: $FORM{'from'}\n";
print MAIL "To: $FORM{'mail'}\n";
print MAIL "Subject: An Postcard for You!\n\n";
print MAIL "========================================================\n";
print MAIL "You have a postcard from $FORM{'from'}.
($FORM{'replyto'})\n";
print MAIL " To retreive this postcard\n";
print MAIL "point your web browser at\n";
print MAIL
"http://www.cityofgardens.com/community/postcard/getcard.pl?$word\n";
print MAIL "Your postcard will expire in two weeks if\n";
print MAIL "you have not got it by then.\n\n";
print MAIL "Sincerely, the folks at cityofgardens.com \n\n";
close MAIL;
}
#***************************************************************
sub page
{
&header;
&title ("Message sent");
print <<ENDOFPAGE;
<h2>Message sent!</h2>
Your postcard has been sent to $FORM{'mail'}.<br>
Your message will expire in two weeks, so make sure that they have got
it by then!<br>
Your postcard will look like this:<hr>
<h3>$messages{$FORM{'picture'}}</h3><br clear=all>
<img hspace=10 vspace=10 src=/community/postcard/pics/$FORM{'picture'}
align=left>
FROM: $FORM{'from'} <hr>
$FORM{'message'}<br clear=left><hr>
Have a look at my awesome <a
href=http://www.cityofgardens.com/>website</a>,
or, send a <a href=/community/postcard/default.htm>postcard to someone
else.<br>
<hr>
<center>
[
<a href="http://www.cityofgardens.com/">My Home Page</a> |
<a href="http://www.cityofgardens.com/community/">My Community Pages</a>
|
<a href="/community/postcard/default.htm">Send a postcard</a>
]
</center>
</body>
ENDOFPAGE
print "</html>";}
------------------------------
Date: Tue, 19 May 1998 10:59:00 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: New Math Modules
Message-Id: <35619E34.EADF9EF7@matrox.com>
Ilya Zakharevich wrote:
> Here comes a confusion: one can consider
>
> F = x y z + 1
>
> as an "expression", and as an element of Z[x,y,z]. In first case
> doing manipulation is called "symbolic manipulations", in the second
> it is just doing manipulation with data (=glorified numbers).
>
> You claim to do the first. PARI does the second.
>
> Since the result is the same, the difference is pretty vague (in your
> case it would correspond to ^0.5 being a badly-defined thing, in PARI
> you need to "pick a branch" in the sense of defining
>
> x_1_2 = mod(t, t^2-x)
>
> which gives you a new datum x_1_2 which behaves as the square root
> of x).
>
> Ilya
To be honest, I don't quite get what you mean. I am not claiming that my modules
are better than PARI. Nor am I saying that they (my modules) are perfect and take
all cases into consideration. I just thought that a mathematical symbolic
manipulation module might be of use to someone out there. Also, I don't understand
what you meant by x_1_2 "behaves as the square root of x" .. but I believe that
x^(0.5) IS the square root of x and its syntax is more intuitive to use.
Anyway, if you don't find any use for my modules then it's ok.. no harm done ;-)
--
Ala Qumsieh | No .. not just another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: 19 May 1998 16:47:32 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: New Math Modules
Message-Id: <6jsd35$i91$1@marina.cinenet.net>
John Porter (jdporter@min.net) wrote:
: On Thu, 14 May 1998 16:20:47 -0400,
: in article <355B521F.F2E90D9D@matrox.com>,
: aqumsieh@matrox.com (Ala Qumsieh) wrote:
: > If you think such modules would be useful, then let me know and I will
: > try to add them to the CPAN archive. (at this point I am not sure if
: > it's worth the hassle!)
:
: Can you give a little more info, such as the functions in the interface,
: and module usage?
Clearly, judging from the thread's subject, this is simply a math module
in which understanding how it operates is far more important than getting
the correct answer. :)
---------------------------------------------------------------------
| 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: 19 May 1998 12:02:57 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Non-static private variables
Message-Id: <6jsafh$hpa$1@monet.op.net>
Keywords: Non-static private variables
In article <6jqgt3$ml4$1@news.nyu.edu>,
George Y. Lembersky <gyl8384@omicron.acf.nyu.edu> wrote:
>I was wondering if anyone knew how to create a non-static (instance)
>private variable in a Perl class.
The conventional implementation of objects as blessed hashes makes it
difficult to do this. There are solutions, but the rest of your note
makes it seem to me that you don't understand the normal situation
very well, so that you would be likely to misunderstand any solution I
explained.
>As I understand Perl classes are just packages, which are just name
>spaces. And instances of these classes are references to thingies which
>are scalars, hashes or arrays.
This is exactly right.
>If this is all there is to an instance of a class, than all of its
>variables must be stored in the arrays or hashes
Also right.
>and these are visible by the package that instantiated this class.
Here's where you're going astray, in several ways:
1. A variable, such as a hash or an array, is not `visible' or
`invisible' to a package. It is a part of the computer's memory.
It only makes sense to talk about the `visibility' of a *name*.
2. A variable might or might not have a name. Or it might have many names.
3. Some names are part of a package, some aren't. But even names
which are part of a package are still visible to other packages.
Now an example:
package P;
sub new {
my $self = {value => 3};
bless $self => P;
}
There's a hash here, but it has no name. It's not `visible' anywhere.
It's an anonymous hash.
There's a reference to the hash, which you can use to locate the hash,
but the reference doesn't have a name either.
For a while the reference is stored in the variable $self. This
variable *does* have a name, `self', but it's not part of the package,
and it's not visible to the package. It's a lexical name, so it's
only visible inside the `new' function. Outside the function, invisible.
So, contrary to what you say, there's really no sense in which the
memebers of the anonymous hash are `visible by the package'. To
operate on this hash, you have to have a copy of the reference to it.
If you have the reference, you can operate on the hash regardless of
what package you're in.
This is exactly what you want. The hash reference is like an object;
to invoke methods on the object or to access the object's instance
data, you have to have the hash reference.
>Is there any way to have instantiated variables that are private?
So I really can't answer your question, because I don't know what you
want. `private' to whom? Protected from whom?
>The variables inside the package are static - they are the same
>across all instances.
Yes, and those aren't private at all:
package P;
$X = 17;
package Q;
$P::X = 'ouch';
Package variables are always global.
------------------------------
Date: 19 May 1998 15:03:01 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Perl for Windows is important, and comments on COM and CPAN
Message-Id: <6js6v5$kgj$1@ns1.arlut.utexas.edu>
Steven Tolkin <steve.tolkin@fmr.com> writes:
>
> P.S. CPAN cannot even be installed on Windows 95.
> This is documented -- it says CPAN is for Unix only.
I don't know about win0.95, but I've had a fair amount of success
using CPAN.pm on NT machines. I've heard, but not actually tried,
using CPAN.pm on NT is best if you've built the perl distribution from
scratch.
(Unfortunately, I can't remember right now what packages I've
successfuly downloaded and built and which ones failed.)
FYI. HTH.
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
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 2639
**************************************