[17369] in Perl-Users-Digest
Perl-Users Digest, Issue: 4791 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 2 09:05:33 2000
Date: Thu, 2 Nov 2000 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973173910-v9-i4791@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 2 Nov 2000 Volume: 9 Number: 4791
Today's topics:
@ARGV and Absolute URL (BUCK NAKED1)
Re: @ARGV and Absolute URL (BUCK NAKED1)
Alternative for server-push animation. <m.gabryelski@psi-net.pl>
backtick question NEWBIE (Jason Goodrow)
Re: backtick question NEWBIE (Rafael Garcia-Suarez)
Calling a perl script from another domain <andrew_long@andrews-models.com.au>
Re: Compiling Perl 5.6 with ming 32 wonderstorm_s@my-deja.com
embedded variables in a file <m.nine.six@freesurf.ch>
Re: embedded variables in a file <xerxes_2k@my-deja.com>
Re: even or odd ? (Anno Siegel)
Re: even or odd ? <bart.lateur@skynet.be>
Re: even or odd ? (Anno Siegel)
Re: Excel access mcnam@my-deja.com
HELP Devive:SerialPort disables ioctl <phil_xxx@my-deja.com>
HELP>>Redirection <r.fraser@student.murdoch.edu.au>
Re: HELP>>Redirection (Rafael Garcia-Suarez)
How can I read out a netgroup? <odenbach@hni.uni-paderborn.de>
how to make a read from a socket non-blocking <ddijk@hetnet.nl>
Re: how to make a read from a socket non-blocking (Garry Williams)
Re: how to read text from filehandle only if it's there <a@b.c>
Re: INTERACTIVE DEBUGGER !!?? <ubl@schaffhausen.de>
Re: Keeping a List of Objects (Anno Siegel)
Re: Keeping a List of Objects (Anno Siegel)
Re: Keeping a List of Objects (Anno Siegel)
Re: Keeping a List of Objects <jeffp@crusoe.net>
Re: Mail::Sender crashes cgi (Rafael Garcia-Suarez)
Re: Multipart response nobull@mail.com
Re: mySQL & Perl <bart.lateur@skynet.be>
OOP and information hiding <s2mdalle@titan.vcu.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 2 Nov 2000 01:49:07 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: @ARGV and Absolute URL
Message-Id: <16137-3A011C73-86@storefull-245.iap.bryant.webtv.net>
What is the best way to read in an Absolute URL? LWP::Simple's
getscore?
Is there a way to read in an absolute URL for processing into @ARGV?
What does $ARGV[0] store anyway?
Thanks,
Dennis
------------------------------
Date: Thu, 2 Nov 2000 02:22:17 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: @ARGV and Absolute URL
Message-Id: <16137-3A012439-89@storefull-245.iap.bryant.webtv.net>
oops... I meant getstore
------------------------------
Date: Thu, 2 Nov 2000 11:06:36 +0100
From: "Maciej Gabryelski" <m.gabryelski@psi-net.pl>
Subject: Alternative for server-push animation.
Message-Id: <8tre20$qv8$2@news.tpi.pl>
Hi there.
I have to make animations in Perl script. The assumption is that it must be
an CGI script not Java aplet. I have just installed module CGI::Push for
server push operations which allow to create animated pages whose content
changes at regular intervals. On this framework I have written simple script
which do animations - it worked fine but only in Netscape Navigator. Then I
have just thought that I have made mistake in my script, and I have
downloaded an example script from www.cgi-resources.com . The downloaded
script had worked only in Netscape Navigator too. The problem is that in my
country ( Poland ) the most popular web browser is MS Internet Explorer. In
this connection I have two questions:
1.) Is this possible that server-push will work in all browsers ( if yes,
how to do that ).
2.) Is there alternative CGI technology for making animations ( I have heard
about client-pull but I couldn't find any manuals, documentation or examples
of it).
Is there anybody who has expierience with this matter. Could I ask for
explanation of this problem ( and/or example code with I can begin).
I am not interested in technologies different from CGI ( like Flash, Java,
animated gifs etc. ).
Thanks in advanced.
Maciej Gabryelski
m.gabryelski@psi-net.pl
PSI-Net www.psi-net.pl
------------------------------
Date: 2 Nov 2000 04:52:06 -0500
From: goodrow@panix.com (Jason Goodrow)
Subject: backtick question NEWBIE
Message-Id: <8trdg6$o4u$1@panix6.panix.com>
A shell call that works from command line but not from cgi input
#!/usr/local/bin/perl5
use CGI qw(:standard);
my $width = param ("width");
open (OUT, ">afile") or die "can't open afile";
print OUT <<EOF;
<stuff>
EOF
close OUT;
$status = `./otherprog $width`;
print "Content-type: text/html\n\n";
print"<html><body>";
print "status = $status";
print "</body></html>";
otherprog returns OK from command line, nothing from cgi-GET input.
(this may be a more ...authoring.cgi question but ... I don't know (very confused))
thanks in advance
goodrow@panix.com
------------------------------
Date: Thu, 02 Nov 2000 10:32:36 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: backtick question NEWBIE
Message-Id: <slrn902gph.mtu.rgarciasuarez@rafael.kazibao.net>
Jason Goodrow wrote in comp.lang.perl.misc:
>A shell call that works from command line but not from cgi input
>
>#!/usr/local/bin/perl5
>
>use CGI qw(:standard);
>
>my $width = param ("width");
>open (OUT, ">afile") or die "can't open afile";
>
>print OUT <<EOF;
>
><stuff>
>
>EOF
>
>close OUT;
>
>$status = `./otherprog $width`;
DON'T DO THAT. This provides the ability to execute any command on your
server (e.g. by supplying width = '|rm -rf /'). Always check your input
parameters. E.g. verify that $width contains only digits.
And supply the complete path for calling otherprog and writing to afile:
the value of current directory is not guaranteed.
BTW, if your command does not execute when run by the web server, it may
be a permission problem.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 2 Nov 2000 21:43:26 +1100
From: "Andrew" <andrew_long@andrews-models.com.au>
Subject: Calling a perl script from another domain
Message-Id: <5BbM5.13364$SF5.292438@ozemail.com.au>
Wondering whether it is possible to call a perl script in the cgi-bin from
another domain - I've experimented but had no success so far.
Reason for doing that is we have a CPU intensive script and we want to share
the load among a number of machines
------------------------------
Date: Thu, 02 Nov 2000 13:11:48 GMT
From: wonderstorm_s@my-deja.com
Subject: Re: Compiling Perl 5.6 with ming 32
Message-Id: <8trp6g$ves$1@nnrp1.deja.com>
In article <8top8v$af0$1@agate.berkeley.edu>,
"Abhishek Roy" <fingerslip@yahoo.com> wrote:
[Harris]:
> > I did not tried ming32 but had similar errors while trying
> > to compile with MSVC++. I was using win95. Changing to
> > Win-NT machine these errors disappeared.
[Roy]:
> I'm using Win98, the readme says that support for ming32 is
> still in the experimental stage, but I suppose *someone*
> must have done it, plus I don't need the whole ActivePerl
> distribution.
> Abhishek
Various FAQs around will also tell you that the command interpreter in
Win9x is seriously broken and inform you that the prospects of ever
getting Perl to build on Win9x are seriously dim. I just built Perl 5.7
on WinNT using mingw (the proper name for ming32 i believe) so it can
be done -- on NT.
One thing you could try if you cannot switch to a machine running NT to
do this, is to install the NT command interpreter to your Win98 system,
and then run the build / install in it. The command interpreter is
named CMD.exe. On the Cygwin website there is documentation that
contains this tip and there is/was a pointer to a URL at M$ for
downloading a CMD.exe that will run on Win9x.
HTH,
soren andersen
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 02 Nov 2000 13:27:05 +0100
From: "m.nine.six" <m.nine.six@freesurf.ch>
Subject: embedded variables in a file
Message-Id: <3A015D99.1654E1AB@freesurf.ch>
hi,
i have some vars embedded in the text file i wishes to read... and when
i print the contents, those vars are just printing as $var, rather than
the contents of $var...
example:
i have the following on line file named "var_file.txt":
$HOME/template
and this is the script:
#!/usr/bin/perl
$HOME = '/home/user/';
$file = 'var_file.txt';
open(FILE, $file);
$line = <FILE>;
close(FILE);
print "$line\n";
and it prints:
$HOME/template
instead of:
/home/user/template
thanks in advance for any help.
--
bye,
alias m.nine.six.
------------------------------
Date: Thu, 02 Nov 2000 12:53:46 GMT
From: arse <xerxes_2k@my-deja.com>
Subject: Re: embedded variables in a file
Message-Id: <8tro4o$uic$1@nnrp1.deja.com>
use a regexp like this
$line =~ s/\$HOME\/(.*?)/$HOME$1/;
--
[][][]{}{}~~';:.<<//?|1¬!"£$$%^^&*(())__+/*+
oooh random characters i must be coool!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 2 Nov 2000 11:41:05 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: even or odd ?
Message-Id: <8trjsh$l7o$1@lublin.zrz.tu-berlin.de>
David Steuber <nospam@david-steuber.com> wrote in comp.lang.perl.misc:
>There are a number of expressions that will do the job. The truth of
>n&1 is one of my favorite if only numbers >=0 are considered. The
>general case would be the truth of n%2.
Are you saying n&1 doesn't indicate parity for negative n? Why?
Anno
------------------------------
Date: Thu, 02 Nov 2000 11:49:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: even or odd ?
Message-Id: <36l20tsu8fivt9gljsp1qrfsle4q3m2nd8@4ax.com>
Anno Siegel wrote:
>>There are a number of expressions that will do the job. The truth of
>>n&1 is one of my favorite if only numbers >=0 are considered. The
>>general case would be the truth of n%2.
>
>Are you saying n&1 doesn't indicate parity for negative n? Why?
I think he might be thinking of 1's complement, where AFAIK ~$n == -$n
for any positive $n. I've never seen this in the real world, though.
--
Bart.
------------------------------
Date: 2 Nov 2000 12:01:24 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: even or odd ?
Message-Id: <8trl2k$laq$1@lublin.zrz.tu-berlin.de>
Bart Lateur <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:
>Anno Siegel wrote:
>
>>>There are a number of expressions that will do the job. The truth of
>>>n&1 is one of my favorite if only numbers >=0 are considered. The
>>>general case would be the truth of n%2.
>>
>>Are you saying n&1 doesn't indicate parity for negative n? Why?
>
>I think he might be thinking of 1's complement, where AFAIK ~$n == -$n
>for any positive $n. I've never seen this in the real world, though.
Oh, right, with 1's complement it would fail.
I'm under the impression that 1's complement has all but vanished from
the scene. Are there still architectures that use it? More specifically,
is there a Perl port to such a system? It would have severe impact
on the wibble generation discussed in another thread :)
Anno
------------------------------
Date: Thu, 02 Nov 2000 11:14:51 GMT
From: mcnam@my-deja.com
Subject: Re: Excel access
Message-Id: <8trib9$qdm$1@nnrp1.deja.com>
In article <39FF395D.5585FB5E@alumni.cwru.edu>,
"Michael V. Schaefer" <mvs@alumni.cwru.edu> wrote:
>
> Is there an API definition for accessing data from
> Microsoft Excel files from w/in a perl script? If
> so what module(s) are required?
* Spreadsheet::ParseExcel. This is a wrapper around the OLE::Storage
module which makes it easy to extract data from an Excel file.
http://search.cpan.org/search?dist=Spreadsheet-ParseExcel
* OLE::Storage, aka LAOLA. This is a Perl interface to OLE file formats.
In particular, the distro contains an Excel to HTML converter called
Herbert,
http://user.cs.tu-berlin.de/~schwartz/pmh/
* DBI, ADO or ODBC. Excel files contain internal formatiing that allows
them to act as database files. Using one of the standard Perl database
modules you can connect to an Excel file as a database.
* HTML tables. If the files are saved from Excel in a HTML format the
data can be accessed using HTML::TableExtract
http://search.cpan.org/search?dist=HTML-TableExtract
* Win32::OLE module and office automation. This requires a Windows
platform and an installed copy of Excel. This is the most powerful and
complete method for interfacing with Excel. See
http://www.activestate.com/Products/ActivePerl/docs/faq/Windows/ActivePe
rl-Winfaq12.html and
http://www.activestate.com/Products/ActivePerl/docs/site/lib/Win32/OLE.h
tml
* There is also an open source C/C++ project based on the LAOLA work.
Try the Filters Project at
http://arturo.directmail.org/filtersweb/ and the xlHtml filter at the
xlHtml Project at http://www.xlhtml.org/
* If your main platform is UNIX but you have the resources to set up a
separate Win32/MSOffice server, you can convert office documents to
text, postscript or PDF using Win32::OLE. For a demonstration of how to
do this using Perl see Docserver:
http://search.cpan.org/search?mode=module&query=docserver
John McNamara
--
"Something tells me we aren't programming in Pascal anymore, Toto."
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 02 Nov 2000 12:12:25 GMT
From: Phil xxx <phil_xxx@my-deja.com>
Subject: HELP Devive:SerialPort disables ioctl
Message-Id: <8trln6$sqr$1@nnrp1.deja.com>
When I use the Device::SerialPort module I get the following warning:
Does anyone know what this is and
how to resolve it?
"disabling ioctl methods - constants not found"
Thanks in advance
Phil.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 02 Nov 2000 15:56:23 +0800
From: Fraser <r.fraser@student.murdoch.edu.au>
Subject: HELP>>Redirection
Message-Id: <3A011E26.EB404ED7@student.murdoch.edu.au>
I want to redirect the user to another page.
I've written a CGI script with some error checking (make sure the user
entered correct details), in a if statement, though if they haven't
written in correctly I would like the script to automatically open a
different html page. How do I do this.
fraser
------------------------------
Date: Thu, 02 Nov 2000 08:14:02 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: HELP>>Redirection
Message-Id: <slrn9028ln.mho.rgarciasuarez@rafael.kazibao.net>
Fraser wrote in comp.lang.perl.misc:
>I want to redirect the user to another page.
>I've written a CGI script with some error checking (make sure the user
>entered correct details), in a if statement, though if they haven't
>written in correctly I would like the script to automatically open a
>different html page. How do I do this.
If you use the CGI module, use :
print $q->("http://server/newlocation"); exit;
before outputting any CGI header.
(and read the CGI.pm docs).
If you don't :
1. You should consider using CGI.pm
2. Simply use :
print "Location: http://server/newlocation\n\n"; exit;
which is merely equivalent to the above.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 02 Nov 2000 11:16:25 +0100
From: Christopher Odenbach <odenbach@hni.uni-paderborn.de>
Subject: How can I read out a netgroup?
Message-Id: <3A013EF9.D77CD32E@hni.uni-paderborn.de>
Hi all,
I am an absolute newbie to perl. Just want to get the
functionality of some shell-scripts into perl. Seeked the
FAQ - no match.
Are there any perl functions or modules for netgroups?
There are C-functions called getnetgrent, innetgr etc.
I can not find in perl. How do I get what I want?
Thanx a lot,
Christopher
------------------------------
Date: Thu, 2 Nov 2000 14:29:06 +0100
From: "dick dijk" <ddijk@hetnet.nl>
Subject: how to make a read from a socket non-blocking
Message-Id: <OEoL9FNRAHA.179@net025s>
Hello,
I wrote a client program that reads from a socket, but I found out that the
read is blocking (if there is nothing to read
the program hangs).
Does anyone know how to make this read non-blocking.
Thanks,
Dick
------------------------------
Date: Thu, 02 Nov 2000 13:59:17 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: how to make a read from a socket non-blocking
Message-Id: <VqeM5.171$FG.12780@eagle.america.net>
On Thu, 2 Nov 2000 14:29:06 +0100, dick dijk <ddijk@hetnet.nl> wrote:
>Hello,
>
>I wrote a client program that reads from a socket, but I found out
>that the read is blocking (if there is nothing to read the program
>hangs).
>
>Does anyone know how to make this read non-blocking.
On Solaris, this works just dandy:
use Fcntl;
unless ( fcntl(CLIENT, F_SETFL, O_NONBLOCK) ) {
die "can't set socket to O_NONBLOCK: $!\n";
}
You probably also need to use only sysread() and syswrite() to access
the socket and you will have to handle EAGAIN. See read(2).
Check your fcntl(2) manual page and the Perl manual pages for Fcntl,
fcntl(), select() and IO::Select.
--
Garry Williams
------------------------------
Date: Thu, 2 Nov 2000 13:23:33 -0000
From: "Kingsley Tart" <a@b.c>
Subject: Re: how to read text from filehandle only if it's there to read?
Message-Id: <pVdM5.3044$1B5.58149@news2-win.server.ntlworld.com>
> perldoc -f select
>
> Unfortunately, there are two 'select' calls that are not related; you want
the
> second one in the doc.
Thanks for that - it's a bit beyond me at the moment with my current
knowledge of Perl so perhaps it's best if I come back to that one later ...
;o)
Cheers,
Kingsley.
------------------------------
Date: Thu, 02 Nov 2000 09:43:52 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: INTERACTIVE DEBUGGER !!??
Message-Id: <3A012947.5A74B321@schaffhausen.de>
Ted Zlatanov schrieb:
>
> tchrist@perl.com (Tom Christiansen) writes:
> > In article <39ff5a6c.1926823@news.one.net.au>, Christopher James <chris@hitsquad.com> wrote:
> > >You guys know of any interactive visual debugger for perl ?
> > >Wanna watch my variables and stuff...
> >
> > First, see perldebug(1), or see the appropriate chapter in the
> > current Camel. Certainly it can "watch your variables and stuff".
> >
> > As for the visual part, I guess that means keeping your eyes open. :-)
>
> It would be unfair to omit the Devel::Ptkdb module, which is very nice
> for beginners. It is on CPAN (http://search.cpan.org). I have found
> it useful many times.
I'm not sure, but doesnt Activestate sell something like a "visual debugger"?
malte
------------------------------
Date: 2 Nov 2000 10:16:33 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Keeping a List of Objects
Message-Id: <8treu2$ks6$1@lublin.zrz.tu-berlin.de>
Jeff Pinyan <japhy@pobox.com> wrote in comp.lang.perl.misc:
>[posted & mailed]
>
>On Nov 1, Anno Siegel said:
>
>>There are situations where all (or some) objects of a class must be
>>notified (updated) in case of an event. So the new() method pushes
>>a reference to each object on an array to have them all accessible.
>>We don't want the objects to collect indefinitely on the list, so the
>>next step is to write a DESTROY method that removes an object when it
>>gets out of scope. The catch is that an object *doesn't* go out of
>>scope as long as it is on the list, so the DESTROY method is never
>>called. (Well, it is called during global destruction, but that's
>>too late to be useful.)
>>
>>Is there a general solution to this problem? The situation can't
>>be rare.
>
>Are you willing to use:
>
> package Obj;
> use Devel::Peek 'SvREFCNT_dec';
Frankly, no. Not for this purpose.
> my %objects;
> # or my @objects
>
> sub new {
> my $self = bless ...;
>
> $objects{$self} = $self;
> # or push @objects, $self
>
> SvREFCNT_dec($self);
> return $self;
> }
>
>It's black magic, sure, but it's allowed.
It should work. It may even continue to work when some other
module decides it wants to play with my refcounts too. However,
reminds me of setting a clock by pulling off the hands and
sticking them back on in the right position. That works too,
until you discover that the day doesn't change at midnight.
Anno
------------------------------
Date: 2 Nov 2000 10:27:52 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Keeping a List of Objects
Message-Id: <8trfj8$kti$1@lublin.zrz.tu-berlin.de>
Uri Guttman <uri@sysarch.com> wrote in comp.lang.perl.misc:
>>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
>
> AS> There are situations where all (or some) objects of a class must be
> AS> notified (updated) in case of an event. So the new() method pushes
> AS> a reference to each object on an array to have them all accessible.
> AS> We don't want the objects to collect indefinitely on the list, so the
> AS> next step is to write a DESTROY method that removes an object when it
> AS> gets out of scope. The catch is that an object *doesn't* go out of
> AS> scope as long as it is on the list, so the DESTROY method is never
> AS> called. (Well, it is called during global destruction, but that's
> AS> too late to be useful.)
>
>i have a similar problem with callbacks and the objects they callback
>both needing refs to each other thereby generating a cycle. i force the
>use of explicit shutdown calls which break the cycles.
>
>another solution which may work for you is to make a parent object which
>owns the object which is on the list. then the parent object (which can
>just be a scalar holding a ref to the real object but inheritance is an
>issue then), would have its DESTROY called when it goes out of scope and
>the proper delete method can be called on the real object.
Yes, as so often, another level of indirection would help. The "proxy
object" approach mentioned in another post is probably similar.
>also check out weak refs in 5.6. the list of objects could be made with
>weak refs so they don't count in reference counting. then when the
>object goes out of scope, DESTROY can delete it from list. making that
>object list a hash might simplify things too.
Aha! That's what weak references are about. I guess I'll ditch
the workaround and give those a try.
Anno
------------------------------
Date: 2 Nov 2000 10:44:14 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Keeping a List of Objects
Message-Id: <8trghu$l4c$1@lublin.zrz.tu-berlin.de>
Rick Delaney <rick.delaney@home.com> wrote in comp.lang.perl.misc:
>[posted & mailed]
>
>Anno Siegel wrote:
>>
>> There are situations where all (or some) objects of a class must be
>> notified (updated) in case of an event. So the new() method pushes
>> a reference to each object on an array to have them all accessible.
>
>See the section, "Weak references", in perldelta for v5.6. They are
>designed specifically for this scenario. Experimental, sure, but not
>quite the black magic that Jeff's suggestion is.
Aha, that's what the murmur about weak references is about. I
had heard of them but postponed a closer inspection to "later".
Later seems to have come. It always does, doesn't it?
>> Is there a general solution to this problem? The situation can't
>> be rare.
>
>Not rare, but unfortunately it has taken a while to get to even an
>experimental solution. Still, if you don't try it, how will we ever
>know if it works well or not. :-)
All right, I'll ditch my workaround and do it the way it's Meant to Be
Done. The appeal to become a guinea pig is overwhelming.
Meep, Anno
------------------------------
Date: Thu, 2 Nov 2000 08:39:23 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Keeping a List of Objects
Message-Id: <Pine.GSO.4.21.0011020838340.25313-100000@crusoe.crusoe.net>
On Nov 2, Anno Siegel said:
>>also check out weak refs in 5.6. the list of objects could be made with
>>weak refs so they don't count in reference counting. then when the
>>object goes out of scope, DESTROY can delete it from list. making that
>>object list a hash might simplify things too.
>
>Aha! That's what weak references are about. I guess I'll ditch
>the workaround and give those a try.
<meek>That's what I was suggesting without knowing there was an ACTUAL
mechanism for doing it.</meek>
I didn't know there was a preferred means to weaken a reference, so I
thought Devel::Peek was the way to go.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Thu, 02 Nov 2000 08:09:49 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Mail::Sender crashes cgi
Message-Id: <slrn9028dq.mho.rgarciasuarez@rafael.kazibao.net>
Jason Goodrow wrote in comp.lang.perl.misc:
>I'm trying to automate the sending of attachments with Mail::Sender from cpan.
>but ...
>The addition of
>
>use lib '/net/u/1/g/goodrow/include/Mail-Sender-0.7.04/blib/lib';
>use Mail::Sender;
>
>crashes when accessed by a GET - works fine from command line.
>I've taken cgi.pm out and pinpointed the addition of those lines.
What's in the error log of your web server?
Does the CGI process have read access to /net/.../lib ? (This means that
all subdirectories must have execute permission).
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 2 Nov 2000 08:36:37 +0000
From: nobull@mail.com
Subject: Re: Multipart response
Message-Id: <u9itq6sott.fsf@wcl-l.bham.ac.uk>
"Tambaa Hapa" <tambaah@x.hotmail.com> writes:
> Anyone know whether libwww-perl has a function to extract multipart
> responses in name= value pairs?
Dunno if libwww-perl has. CGI.pm certainly does.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 02 Nov 2000 12:00:33 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: mySQL & Perl
Message-Id: <vml20too4aieui6r06ea5fk6aa1f529rr6@4ax.com>
Martien Verbruggen wrote:
>> Please, write to me simple program (by Perl).
>
>Please, send me a postal order to the amount of $1500. I'll consider
>it after reception. Final rates can be negotiated at that point.
I think he wants a sample on how to do it. So how do you declare a blob
field in MySQL, and how to you stuff the contents of just any file in
it? I wouldn't know.
But then again, I don't use MySQL; and if I did, I wouldn't even attempt
tp stuff an image file in it. And mos definitely not on a web server.
There's a neat built-in mechanism there: it's called a "file system".
--
Bart.
------------------------------
Date: Wed, 01 Nov 2000 21:43:34 +0500
From: "David Allen" <s2mdalle@titan.vcu.edu>
Subject: OOP and information hiding
Message-Id: <8tqkhf$1bf$1@bob.news.rcn.net>
Recently I've been looking into different aspects o
information hiding in OO languages just out of interest.
I'm quite interested in the way that Perl doesn't
do information hiding in OOP. I've never had a
problem with perl's way of doing things; i.e. I've
never really tried to muck around in the insides of
an object, because I've learned through hard experience
in other languages that it's a good way to break
programs down the line when the implementation of
the object changes. You should stick to the "public"
interface.
Java allows the programmer to enforce access to
variables with 'public', 'private', and 'protected'.
Perl doesn't enforce anything. Frankly, I agree with
that sentiment, since I think a programming language
should let you do whatever you want to, even if that
includes shooting yourself in the foot. :) But
what I'm interested in is *why* perl does it that
way, in other words the language 'philosophy'
behind that decision. I've been trying to find
information on this, and all I've come up with is
a bunch of ways to cheat and get around this limit
and actually come to some sort of enforcement on
variable access. The only two tidbits related to
what I'm looking for are two quotes:
"A programmer who opens up the module and plays around with all the
private little shiny bits that were safely locked up behind the
interface contract has voided the warranty, and you shouldn't worry
about their fate." --- "perldoc perltoot"
"Perl isn't a paranoid language anyway. If people subvert the OO or
IO syntax then they probably know what they're doing and you should
let them do it." --- "perldoc perlbot"
I'm hoping some of the people in these perl groups
can maybe fill in some of the holes for me on why
it is that things were done this way.
Perl has a culture of being permissive (not in the
pejorative sense, but in that it will let you do
things your way, even if your way isn't very good :)
But on the other hand, in terms of permissiveness,
python is pretty much the opposite of perl, yet
doesn't show any difference in this area of the
language, since AFAIK class data is pretty much
public all the time unless you do something else
very specific with it. It makes me doubt that this
aspect of the language design is due to the general
"permissiveness" of perl's design, since it also
occurs in the antithesis of permissiveness.
So what gives? Why this methodology? There are
some more traditional computer scientists whose
hair turns grey at the idea of OOP without information
hiding. Are there any particular technical advantages
in terms of speed/performance in not implementing
these? I wouldn't think so, but it's worth asking.
--
David Allen
http://opop.nols.com/
Official Project Stages:
(1) Uncritical Acceptance
(2) Wild Enthusiasm
(3) Dejected Disillusionment
(4) Total Confusion
(5) Search for the Guilty
(6) Punishment of the Innocent
(7) Promotion of the Non-participants
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4791
**************************************