[19378] in Perl-Users-Digest
Perl-Users Digest, Issue: 1573 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 21 00:05:47 2001
Date: Mon, 20 Aug 2001 21:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <998366711-v10-i1573@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 20 Aug 2001 Volume: 10 Number: 1573
Today's topics:
PERL internet development platforms for less <ahoffman@linux.announce.com>
Re: Alternative to use URI::Escape; <dbe@wgn.net>
Re: Assigning every element of array but the first to a <miscellaneousemail@yahoo.com>
Re: Assigning every element of array but the first to a <krahnj@acm.org>
Re: Assigning every element of array but the first to a (Tad McClellan)
Re: Assigning every element of array but the first to a <miscellaneousemail@yahoo.com>
Re: Counters (Martien Verbruggen)
Re: Crypt::DES problem (Alan Barclay)
Re: Extracting attachments from e-mail <eli@there-is-no-more-qzto.com>
Re: For each Object in ObjContainer ... How to translat (derek chen)
Re: Freelance Perl Programmer (David H. Adler)
Re: How to find out whether a certain class implements <Tassilo.Parseval@post.rwth-aachen.de>
Re: How to remove duplicate records in a huge file?? <smitw1@hotmail.com>
Re: How to remove duplicate records in a huge file?? (John J. Trammell)
Re: How to upload files <dan@nospam_dtbakerprojects.com>
Re: Page Updated Email Script <l_pantin@hotmail.com>
Re: Perl (find a file older then 45mins) <l_pantin@hotmail.com>
PERL compiler for windows <cyberian_bear@hotmail.com>
Re: PERL compiler for windows <matthew.garrish@sympatico.ca>
Re: Perl OO needs the opposite of SUPER:: (John Lin)
Re: Perl OO needs the opposite of SUPER:: (John Lin)
Re: Perl OO needs the opposite of SUPER:: (Martien Verbruggen)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Aug 2001 19:46:21 -0400
From: Allen Ahoffman <ahoffman@linux.announce.com>
Subject: PERL internet development platforms for less
Message-Id: <3b81a14d$1@news2.thevalkyrie.com>
Keywords: PERL devel platform Internet hardware software
Announce Communications Inc
POB 2308
Hyattsville, MD 20784
301-731-5786
kelly@announce.com
See the following speicals and consider, you can have a platform to
develop your applications on without spending a fortune.
Use them as test bed, capacity planning, etc.
The servers below are not the only things we have, talk with us we'll help
you get the platform you need.
Announce Communications new special:
$50/month for:
IBM systems with disk space that grows with you!
Dedicated server with 128mb ram, p200 or better, 10gb data per
month, no set up costs, no minimum term.
Credit cards, checks, money orders accepted.
Linux, FreeBSD loads available.
Debian, Redhat prefered distributions.
Will configure
httpd, sendmail, security firewall, and initial dns.
Will configure webmin for you if you want it.
Daily bandwidth usage available, and metered bandwidth program available.
FreEBSD users, web hosting control panel for $50/month available.
web control panel makes large numbers ov virtual hosts
easy to manage and make money on.
These servers are good for:
web hosting
web development
DNS servers
email groups
MUD(s)
email redirecting
proxy servers
network monitoring
shell accounts (with precautions).
They are no good for:
IRC servers or clients
SPAM
hacking
kitty porn
warez
send email to kelly@announce.com for more information.
Announce Communications new special:
$100/month for:
Dedicated server with 512mb ram, 433mhz or better, 10gb data per
month, 10GB data storage,
no set up costs, no minimum term.
Credit card payment is required.
Linux, FreeBSD loads available.
Debian, Redhat prefered distributions.
Will configure
httpd, sendmail, security firewall, and initial dns.
Will configure webmin for you if you want it.
Daily bandwidth usage available, and metered bandwidth program available.
FreeBSD users, web hosting control panel for $50/month available.
web control panel makes large numbers of virtual hosts
easy to manage and make money on.
These servers are good for:
web hosting
web development
DNS servers
email groups
MUD(s)
email redirecting
proxy servers
network monitoring
shell accounts (with precautions).
medium sized games servers
They are no good for:
IRC servers or clients
SPAM
hacking
kitty porn
warez
send email to kelly@announce.com for more information.
------------------------------
Date: Mon, 20 Aug 2001 16:08:35 -0700
From: "$Bill Luebkert" <dbe@wgn.net>
Subject: Re: Alternative to use URI::Escape;
Message-Id: <3B819873.53A2D794@wgn.net>
Martin Vorlaender wrote:
>
> jtjohnston (jtjohnston@courrier.usherb.ca) wrote:
> > >>use URI::Escape;
> > >>$in{'P1OC2Q1'} = uri_escape($in{'P1OC2Q1'}, "^A-Za-z");
> >
> > A luck would have it, when I tried my script on the University server,
> > URI.pm was not installed in the last installation of libnet. Rather than
> > wait 6 months, can anyone come up with an alternative to URI.pm. I have
> > found this line of code, but does it escape everything?
> >
> > $in{'blah'} =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>
> No. This *de*codes. To (simplistically) encode:
>
> $in{'blah'} =~ s/([^A-Za-z])/sprintf '%%%02X', ord $1/eg;
>
> This, however, escapes way too many characters. OTOH, you could even use
> (.) instead of ([^A-Za-z]).
>
> And it assumes you do this in an ISO8859-1 environment.
Maybe more like:
$string =~ s/([^;\/?:@&=+\$,A-Za-z0-9\-_.!~*'() ])/sprintf("%%%02X",ord($1))/eg;
$string =~ tr/ /+/;
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:dbe@todbe.com
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
------------------------------
Date: Mon, 20 Aug 2001 23:37:19 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Assigning every element of array but the first to a hash??
Message-Id: <MPG.15eb4902e0c0607e989783@news.edmonton.telusplanet.net>
Joe Schaefer at joe+usenet@sunstarsys.com said...
> # use anonymous array(ref) for hash value
> $hash{$temp[0]} = [ @temp[1..$#temp] ]; # see perlreftut for details
I have been chewing on some of this today, looking up anonymous arrays
and other such things, but there is one thing I have not been able to
understand so far.
The "$#" operator. I found references to it in several places but
nothing that really explains it all out. perlvar says this operator is
deprecated. Perlop uses it in an example of the ranger operator ".." but
neither of these give any worthwhile explanation of what this operator
does. Or for that matter what the modern as opposed to deprecated
version is.
Can anyone suggest what documentation might describe it so I can look it
up? I am in the process of downloading cgywin as I write this and expect
to be able to use grep soon but for now I am stuck with Window's Find box
which doesn't show me much when searching for "$#" among the pod's.
Thanks.
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so please don't
subscribe. Thanks.
------------------------------
Date: Tue, 21 Aug 2001 00:36:26 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Assigning every element of array but the first to a hash??
Message-Id: <3B81AD77.FB76FBC@acm.org>
"Carlos C. Gonzalez" wrote:
>
> Joe Schaefer at joe+usenet@sunstarsys.com said...
>
> > # use anonymous array(ref) for hash value
> > $hash{$temp[0]} = [ @temp[1..$#temp] ]; # see perlreftut for details
>
> I have been chewing on some of this today, looking up anonymous arrays
> and other such things, but there is one thing I have not been able to
> understand so far.
>
> The "$#" operator. I found references to it in several places but
> nothing that really explains it all out.
perldoc perldata
> perlvar says this operator is deprecated.
$# is deprecated, $#temp is not the same thing, read perldata
> Perlop uses it in an example of the ranger operator ".." but
> neither of these give any worthwhile explanation of what this operator
> does. Or for that matter what the modern as opposed to deprecated
> version is.
>
> Can anyone suggest what documentation might describe it so I can look it
> up? I am in the process of downloading cgywin as I write this and expect
> to be able to use grep soon but for now I am stuck with Window's Find box
> which doesn't show me much when searching for "$#" among the pod's.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 20 Aug 2001 20:09:14 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Assigning every element of array but the first to a hash??
Message-Id: <slrn9o39la.smi.tadmc@tadmc26.august.net>
Carlos C. Gonzalez <miscellaneousemail@yahoo.com> wrote:
>Joe Schaefer at joe+usenet@sunstarsys.com said...
>
>> # use anonymous array(ref) for hash value
>> $hash{$temp[0]} = [ @temp[1..$#temp] ]; # see perlreftut for details
>
>I have been chewing on some of this today, looking up anonymous arrays
>and other such things, but there is one thing I have not been able to
>understand so far.
>
>The "$#" operator. I found references to it in several places but
^^^^^^^^
Operators are described in perlop.pod.
>nothing that really explains it all out. perlvar says this operator is
^^^^^^^
Variables are not operators. The $# you are talking about _is_
a variable.
The $# above is a special array accessing syntax.
It is doing something regarding the @temp array.
>deprecated. Perlop uses it in an example of the ranger operator ".." but
>neither of these give any worthwhile explanation of what this operator
>does. Or for that matter what the modern as opposed to deprecated
>version is.
>
>Can anyone suggest what documentation might describe it so I can look it
>up?
perldata.pod, since it discusses data types, such as arrays.
>I am in the process of downloading cgywin as I write this and expect
>to be able to use grep soon
Why wait? Write grep(1) in Perl, like I posted about a week ago (wrapped):
http://groups.google.com/groups?as_ugroup=comp.lang.perl.misc&as_umsgid=
slrn9nigt9.a1l.tadmc%40tadmc26.august.net
>but for now I am stuck with Window's Find box
No you're not.
You're never stuck when you have Perl. You write whatever tools
you need. Perl is especially important if you must work in a
tools-poor environment.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 21 Aug 2001 01:54:39 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Assigning every element of array but the first to a hash??
Message-Id: <MPG.15eb6cf68d665ec989784@news.edmonton.telusplanet.net>
Tad McClellan at tadmc@augustmail.com said...
> >The "$#" operator. I found references to it in several places but
> ^^^^^^^^
>
> Operators are described in perlop.pod.
Thanks Tad but the *only* reference to the "$#" in the entire document
(perlop) is this...
for (101 .. 200) { print; }# print $_ 100 times
@foo = @foo[0 .. $#foo];# an expensive no-op
@foo = @foo[$#foo-4 .. $#foo];# slice last 5 items
It is an example talking about using the range operator ".." and as you
can see it does not tell me anything about "$#" other than showing me
that it exists.
I even went through the hassle of searching and looking through every
instance of "#" in perlop thinking that I might have missed something.
Nope. I didn't miss anything of substance regarding the "$#" variable.
> perldata.pod, since it discusses data types, such as arrays.
Ahhh....much better. Thank you. It didn't dawn on me to look for it in
perldata since I thought it was an operator.
> Why wait? Write grep(1) in Perl, like I posted about a week ago (wrapped):
>
> http://groups.google.com/groups?as_ugroup=comp.lang.perl.misc&as_umsgid=
> slrn9nigt9.a1l.tadmc%40tadmc26.august.net
Thanks Tad. I will look into this. I can definitely use a grep. I
remember using it when developing in Delphi and it was an excellent tool.
Cygwin looks good but it's a bit slow going for me to figure out. It
uses some Unix terms that I am not too familiar with. The installer
keeps crashing on me too. I'll keep trying and I will learn but it will
take a bit of time.
Thanks.
---
Carlos
www.internetsuccess.ca
*NOTE*: Internet Success is NOT yet fully operational so please don't
subscribe. Thanks.
------------------------------
Date: Tue, 21 Aug 2001 02:36:22 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Counters
Message-Id: <slrn9o3i96.1qd.mgjv@verbruggen.comdyn.com.au>
[Post re-arranged to obey the normal arrow of time]
On Mon, 20 Aug 2001 16:14:12 +0100,
GBs <newsgroup@buybritishweb.co.uk> wrote:
> John J. Trammell <trammell@haqq.hypersloth.invalid> wrote in message
> news:slrn9o2mh0.rcj.trammell@haqq.hypersloth.net...
>> On Mon, 20 Aug 2001 14:58:07 +0100, GBs wrote:
>> > This may confuse you, but do you know of a graphical access counter
>> > script...
>>
>> Man, page hit counters are *so* 1999.
>
> This isn't just a crappy counter though...it's going to be part of a road
That's, of course, a matter of opinion.
> sign graphic so i need to be able to display a different digit image
> depending on where that digit is in the final count number so that I can put
> perspective on the number images.
I'd look into GD. If that's not sufficient (it's a bit hard to know
what you mean by perspective, it's such an overloaded word), look into
Image::Magick, aka PerlMagick.
Martien
--
Martien Verbruggen |
Interactive Media Division | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 21 Aug 2001 02:16:11 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: Crypt::DES problem
Message-Id: <998360169.461191@elaine.furryape.com>
In article <6c95f2e4.0108141123.6dffb99b@posting.google.com>,
Yiqiang Ding <Ding_yiqiang@yahoo.com> wrote:
>Hi,
>
>A question about Crypt::DES. How can I setup larger blocksize and
>keysize other than default 8?
Do some reading about DES. The blocksize & keysize are defined
as part of the standard.
------------------------------
Date: 21 Aug 2001 00:09:36 GMT
From: Eli the Bearded <eli@there-is-no-more-qzto.com>
Subject: Re: Extracting attachments from e-mail
Message-Id: <eli$0108202001@qz.little-neck.ny.us>
In comp.lang.perl.modules, Don <mail4donpro@home.com> wrote:
> I am using NET::POP3 to read and extract e-mail from a POP3 server. I
> works great. However, now I wish to also extract attachment
> files if they exists and save them in a specified folder on the web
> server. Is this possible in PERL?
You have had some good responses so far, let me add a plug for
something of mine though. From the scripts section of CPAN,
'mimedump' will take a stftime() template for a directory name
and dump message parts to that directory.
It can recurse into attachments, dump message parts normally ignored
(headers, MIME preamble and epilogue), is -Tw/use strict safe.
Some people might not like it since it is a script, not a module;
does a somewhat loose parsing of MIME files (eg guesses at the
boundary if a multipart message with no boundary specified), uses
regular expressions to parse mail headers (which is sure to fail on
some legal headers, but not headers likely to be encountered).
Elijah
------
http://www.cpan.org/authors/id/E/EL/ELIJAH/
------------------------------
Date: 20 Aug 2001 20:54:46 -0700
From: u8526505@ms27.hinet.net (derek chen)
Subject: Re: For each Object in ObjContainer ... How to translate to perl
Message-Id: <85789064.0108201954.38c50d78@posting.google.com>
Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote in message news:<3B7B6EB8.4020104@post.rwth-aachen.de>...
>
> Well, have you read the docs of Win32::OLE? It should have given you
> some hints. Notably, that the Perl version looks surprisingly similar to
> the same thing in VB script:
>
> use strict;
> use Win32::OLE qw(in);
>
> my $object = Win32::OLE->GetObject("IIS://tw-derek/W3svc/1/root/test");
>
> for my $item (in $object) { $item->do_something }
>
> __END__
>
> Due to my lacking a Win-system, this is untested. See the relevant
> documentation for yourself. However, functions such as 'in' and 'valof'
> are not exported by Win32:OLE by default, so you have to do that
> manually as seen in the above use-statement.
>
> Tassilo
It works great,thanks very much.
Derek
------------------------------
Date: 20 Aug 2001 22:20:26 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Freelance Perl Programmer
Message-Id: <slrn9o339a.c4i.dha@panix2.panix.com>
In article <hxne7.135066$Cy.18968138@news1.rdc1.az.home.com>, Bob Ruggeri wrote:
> Hello,
>
> I am looking for a freelance Perl programmer
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
http://jobs.perl.org may be of more use to you
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
A picture is worth
several hundred thousand words...
in the right haiku - Damian Conway
------------------------------
Date: Tue, 21 Aug 2001 00:12:42 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: How to find out whether a certain class implements a method?
Message-Id: <3B818B5A.2000702@post.rwth-aachen.de>
Ilya Martynov wrote:
> Answer is $class->can('method'). See 'perldoc UNIVERSAL'.
Perfect! Thanks a lot for this hint.
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: Mon, 20 Aug 2001 18:48:56 GMT
From: Wim <smitw1@hotmail.com>
Subject: Re: How to remove duplicate records in a huge file??
Message-Id: <8bn2ot47uuulugru1eu1kvkopookugcnos@4ax.com>
Thanks for the tips!!!!!
MD5 doesn't ring a bell for me.
Can someone explain it, or where can I find more information.
Wim
On 20 Aug 2001 14:45:50 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>According to Eric Bohlman <ebohlman@omsdev.com>:
>> Wim <smitw1@hotmail.com> wrote:
>> > How can I remove duplicate records in a huge file?
>> > The file contains about 3.000.000 records (=800Mb)
>>
>> Whenever you see "duplicate," think "hash." The simplest way would be to
>> read each record, use the entire record as a key into a hash, and check if
>> there's already an entry for that key. That, however, will likely use up
>> way to much memory with the amount of data you have. Therefore, I'd
>> compute a "checksum" (e.g. an MD5 digest) for each record and use that as
>> the hash key instead.
>
>Ah, MD5... I like that. To be absolutely waterproof, one might store
>the file position(s) with each key to seek and check duplicates.
>
>> If the file has already been sorted, then you merely need to go through it
>> record by record and compare each record to the previous one.
>
>In a Unix environment, Perl would probably only play a minor part:
>
> 1) Add record numbers in front of each line. These will be ignored
> in most of the steps, but will allow to restore the original order.
> Perl can do this, but other Unix utilities can too.
>
> 2) Sort the file (Unix sort), ignoring the first field (record number).
>
> 3) Use "uniq" to get rid of duplicates, again ignoring the record number.
>
> 4) Sort again, this time using the record numbers, restoring the original
> order.
>
> 4) Remove the record numbers. Again, a Perl one-liner or another Unix
> utility.
>
>Anno
------------------------------
Date: 20 Aug 2001 22:35:45 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: How to remove duplicate records in a huge file??
Message-Id: <slrn9o3jc0.tr7.trammell@haqq.hypersloth.net>
On Mon, 20 Aug 2001 18:48:56 GMT, Wim <smitw1@hotmail.com> wrote:
> Thanks for the tips!!!!!
>
> MD5 doesn't ring a bell for me.
> Can someone explain it, or where can I find more information.
http://www.google.com/search?q=md5
--
Steve Balmer, CEO of Microsoft, recently referred to LINUX as a cancer.
Unsurprisingly, that's incorrect; LINUX was released on August 25th, 1991
and is therefore a virgo.
------------------------------
Date: Tue, 21 Aug 2001 00:27:10 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: How to upload files
Message-Id: <3B81AB23.A3086962@nospam_dtbakerprojects.com>
Fan Hongtao wrote:
>
> I am trying to upload files to a web server outside, The pm that I am
> using is socket and html. But it always give me the error message as
> file is empty? what should I do?
----------
many different ways... and its been asked, and answered many times in
this groups recently. Try reading the docs in FTP::Simple, or CGI
upload() and use the www.google.som search engine on this group with
keywords 'upload file' .
D
------------------------------
Date: Tue, 21 Aug 2001 01:50:19 GMT
From: "Kevin Bartz" <l_pantin@hotmail.com>
Subject: Re: Page Updated Email Script
Message-Id: <v7jg7.27305$1p1.1960309@bgtnsc04-news.ops.worldnet.att.net>
Mass mailers aren't too hard to build. Where are the addresses stored?
Pipe them into sendmail and then feed it your message.
Kevin
In article <a4424021.0108201052.6716285f@posting.google.com>, "Forti2ude"
<rottinam@yahoo.com> wrote:
> Anyone know of a script that will email a group of users that sign up,
> when a page is updated? Please don't tell me about
> http://www.netmind.com/ either! ;-)
------------------------------
Date: Tue, 21 Aug 2001 01:48:00 GMT
From: "Kevin Bartz" <l_pantin@hotmail.com>
Subject: Re: Perl (find a file older then 45mins)
Message-Id: <k5jg7.27303$1p1.1960034@bgtnsc04-news.ops.worldnet.att.net>
Mass mailers aren't too hard to build. Where are the addresses stored?
Pipe them into sendmail and then feed it your message.
Kevin
In article <de41f866.0108201024.5e304b58@posting.google.com>, "Quenten"
<qgriffith@edm1.com> wrote:
> Ok is there a way to use perl to find a file that is older then 45mins
> with a certain extension. Example I have a directory that has a list
> of files with diffrent extensions, but I only want to monitor files with
> an extension like .trl and see if they have been any files there with
> that extension longer then 45mins, and have it ignore any other file in
> that directory. I know how to use perl to check for days, or even the
> find command to check for days, but how can you do it for minutes?
>
> Thanks
------------------------------
Date: Mon, 20 Aug 2001 20:53:23 -0400
From: "cyberian bear" <cyberian_bear@hotmail.com>
Subject: PERL compiler for windows
Message-Id: <cjig7.10$Ik4.282@typhoon.nyu.edu>
Is there any good ones other than Active PERL. Ive tried it and it's very
hard to use and install.
thanks in advance for help.
cb
------------------------------
Date: Mon, 20 Aug 2001 23:09:40 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: PERL compiler for windows
Message-Id: <djkg7.21258$wZ3.1551481@news20.bellglobal.com>
"cyberian bear" <cyberian_bear@hotmail.com> wrote in message
news:cjig7.10$Ik4.282@typhoon.nyu.edu...
> Is there any good ones other than Active PERL. Ive tried it and it's very
> hard to use and install.
> thanks in advance for help.
> cb
>
How's it hard to install? All you have to do is accept some defaults. Sounds
like you need to upgrade your Windows Installer before you try to run the
setup.
http://aspn.activestate.com/ASPN/Downloads/ActivePerl/Requirements?#windows
Matt
------------------------------
Date: 20 Aug 2001 18:49:53 -0700
From: johnlin@chttl.com.tw (John Lin)
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <a73bcad1.0108201749.5c0916f1@posting.google.com>
Joe Schaefer wrote
> > To solve the problem, I have to rename all the inheritor-class's "sub report"
> > into "sub _report". Otherwise I have to re-write the base class Report.
>
> That's not surprising, since ExtendedReport and Report have entirely
> different programming interfaces.
Just like you make improvement to a computer (say, you redesign the main board)
the hard disk, floppy driver, CD ROM should be able to be plugged back to it
with the same interfaces. You can choose to change the interfaces too but
those devices will no more be reusable.
> My main gripe with what you are suggesting is that it allows base-class
> authors to interfere too much with the design of derived classes.
Base class authors only assumes the interface exist and derived class will
(or will not) override it. They just call it from within the base class
without interfereing how the derived classes will implement it.
Thank you.
John Lin
------------------------------
Date: 20 Aug 2001 19:10:04 -0700
From: johnlin@chttl.com.tw (John Lin)
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <a73bcad1.0108201810.6ee8fb4a@posting.google.com>
Ren Maddox wrote
> On 18 Aug 2001, John Lin wrote:
> > But, with current Perl's restriction, using your solution:
> >
> > Report::
> > sub pre_gen; # You need to modify the original class
> > sub gen; # breaking down subroutines into pieces
> > sub post_gen; # which I consider to be ugly :)
> > sub pre_save_as_html;
> > sub save_as_html;
> > sub post_save_as_html;
> > sub pre_print_to_printer;
> > sub print_to_printer;
> > sub post_print_to_printer;
> >
> [snipped ExtendedReport skeleton]
>
> At first blush, I'm not visualizing why you would need all of this.
> If you are expecting virtual report to handle everything, then
> pre_report and post_report can handle it. There is no need for
> pre_gen, post_gen, etc.
Sorry, I meant:
sub gen {
$self->pre_report_in_gen;
$self->report;
$self->post_report_in_gen;
}
and also
pre_report_in_save_as_html;
post_report_in_save_as_html;
pre_report_in_print_to_printer;
post_report_in_print_to_printer;
...
Actually what I tried to say was:
Since we want to override the "interface", then orerride it, and done!!!
Instead, you have to find out every spots where this "interface" is used/called,
and re-arrange the caller (gen, save_as_html, etc) into pieces of ugly codes.
That's considered (by me) a drawback of current Perl OO.
In most cases, reusing base-class requires that you don't modify it.
For example, the base class is downloaded from CPAN, or it is the company's
legacy kernel code. (Hey, reusing, not re-writing!)
In my solution, everything is done in the middle layer.
The base class doesn't need to be touched.
And it can focus on "what you want to do" and no extra efforts needed.
Thank you.
John Lin
------------------------------
Date: Tue, 21 Aug 2001 02:26:38 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <slrn9o3hmq.1qd.mgjv@verbruggen.comdyn.com.au>
On 18 Aug 2001 20:16:12 -0700,
John Lin <johnlin@chttl.com.tw> wrote:
> Martien Verbruggen wrote
>
>> This may very well be true, but it doesn't justify throwing over years of
>> OO wisdom that a base class categorically doesn't ever want to know about
>> its inherited child classes.
>
> No. What I am talking about is just like Java's "interface".
You are, possibly, but you're also talking about abstract
superclasses, and inheritance. They are different solutions to the
same or similar problems.
An interface is nothing more than a set of guaranteed methods that can
be called on an object. a class implementing an interface has to
provide the methods proscribed by the interface.
A class that inherits from an abstract module (that has nothing else
but abstract methods), also has to provide an implementation of all
these methods.
In languages where multiple inheritance is forbidden, interfaces are
often used. For example, in Java, an interface is really just a purely
abstract class. Instead of directly inheriting, you 'implement the
interface'.
Semantically, there's a difference. Inheritance is normally done when
your object _is a_ parent object. Interfaces are used when your object
_can_ do the things the interface proscibes.
A car, a truck and a bicycle are vehicles, and will most likely (maybe
via intermediates) inherit from a vehicle class.
A laser printer, copier and desk chair are all office equipment. Only
the first two are electrical. Multiple inheritance could set up a
class OfficeEquipment, and one ElectricalAppliance, and solve the
problem. When that isn't allowed, one could create
ElectricalOfficeEquipment to inherit from OfficeEquipment, and inherit
from those. ElectricalOfficeEquipment most likely would implement an
interface called ElectricalEquipment.
The line between interfaces and superclasses is very thin, and murky.
Interfaces are most often used when your object _is_ already something
else, but it needs to provide extra functionality, outside of the
normal functionality that already exists. Think of adding a network
card to both of the appliances above. You'd implement an EtherNet and
SNMP interface, instead of inheriting from those classes.
In the case of the Report classes you chose as an example, Report
could be the interface. This would mean it would provide a purely
abstract set of methods that all classes implementing this interface
would provide. However, you had actual implementations of classes,
inheriting from Report, without inheriting from something else. you
may be providing an interface for something else, but the problem at
hand was the implementing the inheritance of closely related classes.
That is not an interface issue.
Perl is not like Java. Perl's OO model allows many things you can't do
in Java. It does not have interfaces like Java has. Providing an
interface is a much looser concept in Perl. Perl's object aren't type
checked as they are in Java. The DBD classes all provide an interface
for the DBI module to use. How an interface is implemented in Perl
(via inheritance of a superclass, multiple inheritance, purely by
convention) is a separate issue, and not what your question was about.
> The base class doesn't require to know anything about the inheriting classes.
> All it needs to do is assuming the presence of the interface method.
But that has nothing to do with whether it's implementing an interface
or not.
If you want your child classes to implement a certain itnerface, the
logical, and most common, way to deal with that is to provide abstract
methods that the child classes _have_ to override. To look at making
your children implement an interface which is separate from the
functionality you provide yourself is unnecessary, and makes things
just murky.
Your children _are_ already like you. You can make use of that fact
without any extra interface.
> This "interface" concept is very common in OO's polymorphism designing, right?
> So I am not throwing away OO's wisdom. Instead I try to patch Perl's OO.
maybe I'm just misunderstanding you, but to me it sounds like you're
trying to screw in OO screws with an OO hammer.
> Looking at the problem (or restriction) that simplex (not even half-duplex)
> SUPER:: causes, only the duplex "SUPER::+VIRTUAL::" OO can solve it elegantly.
But, in this case, it isn't necessary at all. And I can't really come
up with a case where it would be. You got two solutions that gave you
an idea on how to implement this cleanly [1]
> I mean "the problem" (or restriction) by
>
> ### Perl's simplex (SUPER:: only) OO ###
> The same "interface" in an inheritance hierarchy MUST NOT have the same name.
>
> ### Extended duplex (SUPER::+VIRTUAL::) OO ###
> The same "interface" in an inheritance hierarchy WITH THE SAME NAME supported.
I don't follow this, sorry..
Martien
[1] mine disregarded the gen() method, and instead assumed that
report() would be called directly. That was a misunderstanding on my
part, but the point still stands; the song remains the same...
--
Martien Verbruggen |
Interactive Media Division | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1573
***************************************