[12086] in Perl-Users-Digest
Perl-Users Digest, Issue: 5686 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 16 11:07:14 1999
Date: Sun, 16 May 99 08:00:15 -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 Sun, 16 May 1999 Volume: 8 Number: 5686
Today's topics:
DBI not thread safe. Another way? <darreld@his.com>
Re: Hash arrays armchair@my-dejanews.com
Re: How to program a shell '#!<program>' statement. <Michael.Mueller4@post.rwth-aachen.de>
Re: How to program a shell '#!<program>' statement. <andrew@erlenstar.demon.co.uk>
Re: Know any perl scripts to serve web based email? (Marcel Grunauer)
Re: man pages and FAQs: why posted? (Larry Rosler)
Re: man pages and FAQs: why posted? <tchrist@mox.perl.com>
Re: Microsoft IIS4 <lone.wolf@net.ntl.com>
Re: open, read,then print a file armchair@my-dejanews.com
Re: open, read,then print a file (Sam Holden)
Re: Perl "constructors" <rick.delaney@home.com>
Re: Perl "constructors" armchair@my-dejanews.com
Re: Perl "constructors" (Sam Holden)
Re: Perl "constructors" (Randal L. Schwartz)
Re: perltootc - OO Tutorial for Class Data in Perl <tchrist@mox.perl.com>
Re: perltootc - OO Tutorial for Class Data in Perl <tchrist@mox.perl.com>
Re: perltootc - OO Tutorial for Class Data in Perl <tchrist@mox.perl.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 16 May 1999 09:53:03 -0400
From: Darrel Davis <darreld@his.com>
Subject: DBI not thread safe. Another way?
Message-Id: <373ECDBF.BCA107EC@his.com>
I have been blissfully building a multi-threaded server that connects
to a database in thread via DBI , messes with data and builds return
strings and sends tem back to the client. I read last night that DBI is
not thread safe and is recommended to NOT open DBI with > 1 thread.
Are there any other ways of going about this? I would be OK with all
clients accessing the DB through a single DBI connection to MySQL
but am unclear how to do this under Perl. I've really been enjoying
coding in Perl, though.
-darrel
=================================================
Darrel L. Davis darreld@his.com
Linux - The choice of a Gnu generation
===================================================
------------------------------
Date: Sun, 16 May 1999 14:21:45 GMT
From: armchair@my-dejanews.com
Subject: Re: Hash arrays
Message-Id: <7hmk9o$ooi$1@nnrp1.deja.com>
In article <slrn7jt951.46f.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:
> Alternatively you could write a simple Benchmark and see if the
> cost of $count = keys %hash; is O(n) or O(1) or O(n**2) or whatever.
Welllll, dogee, granny, I do believe this here boy is one of them
there computer scientists.
> --
> Sam
>
> It was the damndest thing, once the gators heard Holden
> complaining again about not reading line 148 of FAQ8, they
> all turned around and ran for the water. -- Crocodile Dundee
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: Sun, 16 May 1999 15:31:53 +0200
From: Malware <Michael.Mueller4@post.rwth-aachen.de>
Subject: Re: How to program a shell '#!<program>' statement.
Message-Id: <373EC8C9.11406934@post.rwth-aachen.de>
Hi Barry,
you wrote:
> The pathname of the script file is passed as the last argument to the
> interpreter named in the #! line. If it were passed as stdin, how would a
Are you sure about this being a standard? I just tried on Linux 2.3.2
and there it is passed as argv[1]. So does SunOS 5.6.
Malware
------------------------------
Date: 16 May 1999 15:36:43 +0100
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: How to program a shell '#!<program>' statement.
Message-Id: <873e0xxero.fsf@erlenstar.demon.co.uk>
[followups set]
>>>>> "Malware" == Malware <Michael.Mueller4@post.rwth-aachen.de> writes:
>> The pathname of the script file is passed as the last argument to
>> the interpreter named in the #! line.
Malware> Are you sure about this being a standard? I just tried on
Malware> Linux 2.3.2 and there it is passed as argv[1]. So does SunOS
Malware> 5.6.
To be precise, there are two possibilities for the argv of the invoked
interpreter:
If the script begins with just "#!/path/to/interpreter" then
argv[1] = the path of the script file
argv[2] = the original argv[1] from execve
argv[3] = the original argv[2] from execve
etc.
If the script begins with "#!/path/to/interpreter some_argument" then
argv[1] = "some_argument"
argv[2] = the path of the script file
argv[3] = the original argv[1] from execve
etc.
Note that only one argument is allowed in the #! line.
(This is useful for invoking programs like awk as interpreters,
by using "#!/usr/bin/awk -f")
(ObPerl: Perl uses a certain amount of jiggery-pokery to circumvent
the one-argument restriction, by parsing the #! line itself. Details
should be in the perlrun manpage.)
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>
------------------------------
Date: Sun, 16 May 1999 14:09:22 GMT
From: marcel.nospam.grunauer@lovely.nospam.net (Marcel Grunauer)
Subject: Re: Know any perl scripts to serve web based email?
Message-Id: <373fc96b.8986561@enews.newsguy.com>
On Tue, 11 May 1999 21:04:37 -0700, nickysantoro@yahoo.com (Nick
Santoro) wrote:
> Hello,
> Does anybody know any scripts to serve web based email, (a la Hotmail,
>yahoo mail, etc.) using perl and cgi?
>Thanks
>N/S
I suspect it depends on how the specific web mail providers format
their pages. I don't know of any way of talking directly to their mail
servers, so to get at hotmail mails, I've tried to grab the info off
their web pages.
The following script just prints a list of messages in your hotmail
inbox. It does this by simulating step by step what you would do in
your browser.
Pass the script the username and password, like so:
hotmail userfoo passbar
It's not pretty, but it's a start. Any suggestions and improvements
are welcome.
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common qw(POST);
use HTTP::Status;
use HTTP::Cookies;
my $url = "http://lw1lg.hotmail.com/cgi-bin/dologin";
my ($username, $password) = @ARGV;
# Create a new user agent and cookie jar, as hotmail uses cookies.
# Use some dummy agent id
my $ua = new LWP::UserAgent;
$ua->agent("Mozilla/2.0 (compatible; MSIE 3.02; Update a; AK; Windows
95)");
$ua->cookie_jar(HTTP::Cookies::Netscape->new);
# Simulate a POST to hotmail's home page
my $request = POST $url, [login => $username, passwd => $password];
my $response = $ua->request($request);
# If we got a redirect, extract the Location and follow it
if ($response->code eq RC_FOUND) {
if ($response->as_string =~ /Location: (.*)/i) {
$request = new HTTP::Request("GET", $1);
$response = $ua->request($request);
# we now have a frameset. Follow the "work" frame
if ($response->as_string =~ /name="work"
src="(.*?)"/i) {
$request = new HTTP::Request("GET", $1);
$response = $ua->request($request);
$_ = $response->content;
/(\d+) messages, (\d+) new/i;
print "$1 messages, $2 new\n";
# messages are displayed in table rows with
pink backgrounds
# extract them one after another, then dissect
them
while (/eeeecc">(.*?)<\/tr>/gc) {
my $mail = $1;
# remove HTML tags
$mail =~ s/<.*?>//g;
# remove spaces at the line start
$mail =~ s/^( )+//g;
# more than one space means 'new
column'
$mail =~ s/( ){2,}/ | /g;
# convert spaces from HTML to ASCII
$mail =~ s/ / /g;
print "$mail\n";
}
}
}
}
# Issues:
# - Surely there's a better way to follow that first redirect?
# - Extracting the mail info is very ugly with that regexp that tests
# for some cell background
# - Converting the HTML to something readable isn't pretty either
HTH
Marcel
------------------------------
Date: Sun, 16 May 1999 07:02:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: man pages and FAQs: why posted?
Message-Id: <MPG.11a86fda947f8d54989a75@nntp.hpl.hp.com>
In article <373eab00.6853541@news.skynet.be> on Sun, 16 May 1999
11:44:13 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> John Callender wrote:
> >Lee <rlb@intrinsix.ca> wrote:
> >> I have been reading this ng for quite a while, and also surmised those same
> >> reasons. But I don't think it will be effective, and I think it is an
> >> enormous waste of bandwidth.
> >
> >I think this "enormous waste of bandwidth" charge is suspect. What do
> >you really mean by it?
>
> At times, the PERLFUNC and FAQ post comprise about half of all threads
> in this newsgroup. That *IS* quite a lot.
The 'times' you are referring to are early mornings in North America and
weekends. During normal traffic times they are 'down in the noise' --
of which there is plenty -- in quantity, but still stand out in quality.
My main complaint is that they are not being edited on a cycle-to-cycle
basis in response to feedback from the newsgroup. The purpose of
publishing them is not only to enlighten the readers and to prime Deja,
but also to subject the material to scrutiny. This can become
frustrating if bugs are not fixed between appearance.
For example, FAQ 4.31: "How do I pad a string with blanks or pad a
number with zeroes?" has just reappeared with the same bug that was
pointed out on the previous pass. There are several others.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 16 May 1999 08:23:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: man pages and FAQs: why posted?
Message-Id: <373ed4e2@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:My main complaint is that they are not being edited on a cycle-to-cycle
:basis in response to feedback from the newsgroup.
I am trying, you know.
--tom
--
"At my order, and for the good of the state,
the bearer has done what has been done."
- Cardinal Richelieu
------------------------------
Date: Sun, 16 May 1999 14:51:26 +0100
From: "Lone Wolf" <lone.wolf@net.ntl.com>
Subject: Re: Microsoft IIS4
Message-Id: <373ecb29.0@145.227.194.253>
if you took your head out of your arse and helped then maybe my next
question, which I would have posted and probably wont now that I have been
flamed on my first post, would have been about the best way to create a
search engine using the facilities of IIS since I cant get perl to work with
it Even after looking at this months Technet.
So now I shall have to play with the 2 different ways of making a search
engine and see what I come up with.
Michel Dalle wrote in message <7hi62a$8a4$4@xenon.inbe.net>...
>In article <373c8829.0@145.227.194.253>, "Lone Wolf"
<lone.wolf@net.ntl.com> wrote:
>>I cant get perl to work with my IIS version 4 server.
>[a long list of actions snipped]
>
>Have you REALLY looked at the ActivePerl FAQ ? There's a nice chapter
that's
>called : "How do I configure IIS 4.0 to support Perl for Win32?"
>
>There is also some documentation on IIS 4.0 about Perl, in case this
doesn't
>work.
>
>There is also a newsgroup called comp.infosystems.www.servers.ms-windows,
>that sometimes deals with IIS4 problems.
>
>There is also a newsgroup called microsoft.public.inetserver.iis, that also
>deals with IIS4 configuration problems.
>
>There are also more than 50 articles on search.microsoft.com.
>
>There is, however, nothing in your question that corresponds to what this
>newsgroup is all about, i.e. Perl itself :-)
>
>Good luck,
>
>Michel.
------------------------------
Date: Sun, 16 May 1999 13:12:12 GMT
From: armchair@my-dejanews.com
Subject: Re: open, read,then print a file
Message-Id: <7hmg7d$m9l$1@nnrp1.deja.com>
In article <7hj78o$atj$2@justice.csc.cuhk.edu.hk>,
austin95002887@yahoo.com (Austin Ming) wrote:
>
> How to open, read,then print a text.txt file to the browser in current
> dierectory ?
>
>
Have added Larry Rosler's suggestions and corrections:
*******************************************************************
#!/usr/local/bin/perl -w
use strict;
print "Content-Type: text/plain\n\n";
my $input_file = "test.txt";
my $scalar = open(INPUT_FILE,"<$input_file");
if ( $scalar )
{
my $file_line = "";
while ( $file_line = <INPUT_FILE> )
{
print "--> $file_line";
}
close (INPUT_FILE);
}
else
{
print STDOUT "CGI SCRIPT ERROR:Unable to open file $input_file !!!\n";
}
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 16 May 1999 14:39:11 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: open, read,then print a file
Message-Id: <slrn7jtm4f.7jo.sholden@pgrad.cs.usyd.edu.au>
On Sun, 16 May 1999 13:12:12 GMT, armchair@my-dejanews.com wrote:
>In article <7hj78o$atj$2@justice.csc.cuhk.edu.hk>,
> austin95002887@yahoo.com (Austin Ming) wrote:
>>
>> How to open, read,then print a text.txt file to the browser in current
>> dierectory ?
>>
>>
>Have added Larry Rosler's suggestions and corrections:
>*******************************************************************
>#!/usr/local/bin/perl -w
>use strict;
>
>print "Content-Type: text/plain\n\n";
>
>my $input_file = "test.txt";
>my $scalar = open(INPUT_FILE,"<$input_file");
>
>if ( $scalar )
Why not use :
if (open(INPUT_FILE, "<$input_file")
Even if you don't you could use a better name than $scalar. Of course
it's probably sample code so it doesn't really matter...
>{
> my $file_line = "";
Just my $file_line would do, since you don't use it before setting it.
> while ( $file_line = <INPUT_FILE> )
> {
> print "--> $file_line";
> }
> close (INPUT_FILE);
>}
>else
>{
> print STDOUT "CGI SCRIPT ERROR:Unable to open file $input_file !!!\n";
Why STDOUT here, but not in the other two prints?
Of course it's 12:38am over here and I'm just being picky...
--
Sam
Every human culture has good and bad points. Every computer program has
Eveone more bug. Even Perl.
--Larry Wall
------------------------------
Date: Sun, 16 May 1999 13:29:20 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Perl "constructors"
Message-Id: <373EC7D3.EF1D612F@home.com>
[posted & mailed]
Ilya Zakharevich wrote:
>
> I think this means
>
> "Number of the last parenth matched in the last successful REx in
> the scope is more or equal to $record{array}"
^^^^^^^^^^^?
s/or equal to/than/;
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 16 May 1999 14:07:10 GMT
From: armchair@my-dejanews.com
Subject: Re: Perl "constructors"
Message-Id: <7hmjed$o45$1@nnrp1.deja.com>
In article <slrn7jten6.fth.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:
> On Sun, 16 May 1999 12:07:43 GMT, armchair@my-dejanews.com wrote:
> >
> >Yes, I have seen that code as in:
> >
> >my $scalar = "100";
> >$scalar += 10;
> >print $scalar; # prints 110
> >
> >very disturbing indeed.
>
> But that's just bad programming. It becomes extremely useful for
things like :
>
> my $scalar = <>;
> $scalar+=10;
> print $scalar;
>
> Since you don't have to much around with converting a string to a
number.
>
> It's also very useful like this :
>
> my $count = 10;
> print "The count is $count\n";
>
I have no problem using atoi() or atof() to convert between types. Why
didn't you comment on the second part of that post regarding the part
where the Perl manual gives an example of how to test that a scalar is
really a number, and then comments that it will cause warnings to pop
out if you just happen to be using -w??
At this point I was going to ask a question relating to internal
representations of scalars, but when I did perldoc -q scalar, some info
in the much ballyhooed and renowned FAQ4 popped up, and it had a
question - How do I determine whether a scalar is a
number/whole/integer/float? Unfortunately, in order to understand the
internal representation the answer implies, I need to learn regular
expressions. But I did check the FAQ!!! Put another shrimp on the barby!
> --
> Sam
>
> I found Sam to be a somewhat interesting date, although he
> did seem to be extremely fixated on some ex of his
> named Pearl. --Elle MacPherson
>
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---
------------------------------
Date: 16 May 1999 14:52:42 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl "constructors"
Message-Id: <slrn7jtmtp.7jo.sholden@pgrad.cs.usyd.edu.au>
On Sun, 16 May 1999 14:07:10 GMT, armchair@my-dejanews.com wrote:
>In article <slrn7jten6.fth.sholden@pgrad.cs.usyd.edu.au>,
> sholden@cs.usyd.edu.au wrote:
>> On Sun, 16 May 1999 12:07:43 GMT, armchair@my-dejanews.com wrote:
>> >
>> >Yes, I have seen that code as in:
>> >
>> >my $scalar = "100";
>> >$scalar += 10;
>> >print $scalar; # prints 110
>> >
>> >very disturbing indeed.
>>
>> But that's just bad programming. It becomes extremely useful for
>things like :
>>
>> my $scalar = <>;
>> $scalar+=10;
>> print $scalar;
>>
>> Since you don't have to much around with converting a string to a
>number.
>>
>> It's also very useful like this :
>>
>> my $count = 10;
>> print "The count is $count\n";
>>
>
>I have no problem using atoi() or atof() to convert between types.
Whereas I am lazy and would rather perl did it all for me. When I use a
string as a number, perl is good enough to convert convert it to a number
for me. I like it. But I'm very lazy.
>Why
>didn't you comment on the second part of that post regarding the part
>where the Perl manual gives an example of how to test that a scalar is
>really a number, and then comments that it will cause warnings to pop
>out if you just happen to be using -w??
Because I didn't feel like it.
It isn't an example of testing that a scalar is really a number, it is
testing that it is a non-zero number. It then gives some regexes to match
certain classes of numbers, which is much more likely what you will be
interested in, in practical application.
Using a construct that causes a warning to be generated when you know why the
warning will be generated and it is not a problem is OK in perl. You just
disable warnings for that bit of code. Same with munging with the symbol
table is OK even though 'use strict;' is considered a good thing, you just
disable it for that bit of code. After all the programmer knows it's OK.
He/she meant to use a non-numeric as a number, since that is what they were
testing.
I was thinking and wouldn't using the string as a number and catching the
warning, though messing with $SIG{__WARN__} is probably more difficult now
that I think about it.
>
>At this point I was going to ask a question relating to internal
>representations of scalars, but when I did perldoc -q scalar, some info
>in the much ballyhooed and renowned FAQ4 popped up, and it had a
>question - How do I determine whether a scalar is a
>number/whole/integer/float? Unfortunately, in order to understand the
>internal representation the answer implies, I need to learn regular
>expressions. But I did check the FAQ!!! Put another shrimp on the barby!
>
>
>> --
>> Sam
>>
>> I found Sam to be a somewhat interesting date, although he
>> did seem to be extremely fixated on some ex of his
>> named Pearl. --Elle MacPherson
Well I'm sick of having you put down my entire country and falsely quote
me in a public forum. Have fun with perl.
--
Sam
We prefer English to remain a rich language, quirky, sloppy, and full
of redundancy. Same for Perl.
--Larry Wall
------------------------------
Date: 16 May 1999 07:58:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl "constructors"
Message-Id: <m1yaipuklo.fsf@halfdome.holdit.com>
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:
Russ> Perl is a garbage-collected language that handles memory allocation
Russ> itself.
Picking small nits here, it's not *currently* a GC language. It's a
reference-counting language (which means that memory can be orphaned).
Someday, we may get mark-n-sweep style GC.
I suppose if you define GC as the set of "transparent memory
allocation" languages, yours would do. I don't recall hearing it used
that way though.
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 16 May 1999 07:05:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perltootc - OO Tutorial for Class Data in Perl
Message-Id: <373ec2a9@cs.colorado.edu>
Cursed by Microsoft Outlook Express 5.00.2014.211, "Stephen Warren"
<swarren@www.wwwdotorg.org> wrote on Sun, 16 May 1999 06:45:44 GMT in
comp.lang.perl.misc:
>Some comments in the form of a unified diff. I hope people can grok this,
>but I figured it would be the most convenient way to merge them into the
>original .pod file...
I'm afraid that what you sent wasn't a valid diff: you got screw-wrapped.
You are being tortured by the Horror Out of Redmouth. May the Lord Bill
have mercy on your pocket book, for it is clear that he has had none
on anything else in your life.
> object, the &spawn constructor uses the existing object as a template
> and copies in its values instead of leaving them translucently undefined.
>+XX Stephen Warren comment:
>+XX The last sentence might be a little confusing. I first read it to mean
>+XX that after $ob4=$ob3->spawn(); even those values in $ob3 that were
>+XX translucent wouldn't be in $ob4. In retrospect, it does mean what you say,
>+XX since it actually means it will copy what keys exist and hence everything
>+XX else *will* stay translucent, but that took thinking about:-)
Point taken. Here's some new verbage that might help:
If you now use $ob3 to spawn off another object, the new object
will take the color its parent held, which now happens to be
"chartreuse". That's because the constructor uses the invoking
object as its template for initializing data attributes. When that
invoking object is the class name, the object used as template is the
eponymous meta-object. When the invoking object is a reference to
an instantiated object, the &spawn constructor uses that existing
object as a template. That means that any actual values set on
that template object will be copied in to the new object as well.
But attributes undefined in the template object, being translucent,
will remain undefined in the new one, too, rendering them translucent
in the new one, too.
> $ob4->color(undef); # back to "azure"
>+XX Stephen Warren comment
>+XX Depends on implementation... Since this is before the code, it might
>+XX help to note that we are using defined() rather than exists() for the
>+XX determination of translucency below. Otherwise, one's first though on
>+XX reading the above might be that it doesn't work. Of course, on reading
>+XX the code, it all became clear.
Here's some added clarification at that point:
If you have an object with a discrete (read: not translucent)
attribute value, but you want to make that object's attribute value
translucent again later, what do you do? Let's design the class so
that when invoke an accessor method with C<undef> as its argument, it
returns to its translucent nature and allows the class meta-object's
current value for that attribute to shine through again.
$ob4->color(undef); # back to "azure"
> Here's a complete implementation of Some_Class as described above.
> %$self = %$obclass unless $class;
>+XX I might be stupid, but doesn't $class always evaluate to true?
Good catch. Looks like that was the unwilling victim of a
sweeping unification step at some point. It should read:
%$self = %$obclass if ref $obclass;
>@@ -828,6 +848,15 @@
> Translations to C++, Java, and Python have been left as exercises for
^
^
^ Insert "of this closure-based approach"
> the reader. Be sure to send us mail as soon as you're done.
>+XX _classobj, anyone? <grin>
I don't care for it very much, actually, at least when it's
used to gaint surreptious access the private class data object
by outsiders. Here's an addendum:
... in other words, through method invocations. And not even through
just any method, either. Methods that begin with an underscore are
traditionally considered off-limits outside the class.
>+XX I guess this has probably been discussed elsewhere already, but...
>+XX I wonder about the name our(). I can certainly see the similarity
>+XX to my(), but wonder if sym(), declare(), define() might not be
>+XX slightly more immediately obvious to the casual observer? Who knows.
First of all, I don't think that it would. sym() is too magical a name;
declare() conveys no indication of its local/global nature, and define()
is too close to defined() and undef() in naming, and too far in meaning.
Second of all, making something obvious to "the casual observer" is not
necessarily the first principle by which these things should be judged.
The casual observer should hurry up and bring me my french fries. :-)
Finally, Larry said it would be our(), and Rule #1 takes precendence.
--tom
--
"Though a program be but three lines long,
someday it will have to be maintained."
------------------------------
Date: 16 May 1999 07:11:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perltootc - OO Tutorial for Class Data in Perl
Message-Id: <373ec3eb@cs.colorado.edu>
I wrote:
: Class Data as Package Variables
: Putting All Your Eggs in One Basket
: Inheritance Concerns
: The Eponymous Meta-Object
: Indirect References to Class Data
: Monadic Classes
: Translucent Attributes
: Class Data as Lexical Variables
: Privacy and Responsibility
: File-Scoped Lexicals
: More Inheritance Concerns
: Locking the Door and Throwing Away the Key
I've gotten some feedback that this posting was too large to be easily
digested in a quick read, and that perhaps it should have been posted in
smaller segments, such as each piece in the outline above. Would that
really have helped people read and understand these? Wouldn't it have
seemed more like spam than like an ten-part mini-series? :-)
--tom
--
"Did you know, 50% of doctors graduated at the BOTTOM HALF of their class."
------------------------------
Date: 16 May 1999 08:02:00 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perltootc - OO Tutorial for Class Data in Perl
Message-Id: <373ecfd8@cs.colorado.edu>
I've posted the formatted versions on my web site. You can
access them from the links in the first entry of the What's New
page:
http://language.perl.com/admin/whats_new.html
--tom
--
"Everything you said about Plan 9 is wrong"
-- Rob Pike, letting a speaker have it
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5686
**************************************