[17714] in Perl-Users-Digest
Perl-Users Digest, Issue: 5134 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 17 18:05:36 2000
Date: Sun, 17 Dec 2000 15: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: <977094310-v9-i5134@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 17 Dec 2000 Volume: 9 Number: 5134
Today's topics:
Re: Ada feature borrowed for Perl?? <peter.sundstrom@eds.com>
choosing which packages to use at run time <eidheim@hivolda.no>
Re: choosing which packages to use at run time <tinamue@zedat.fu-berlin.de>
Re: choosing which packages to use at run time <jeffp@crusoe.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 18 Dec 2000 10:36:42 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Ada feature borrowed for Perl??
Message-Id: <91jblb$7ti$1@hermes.nz.eds.com>
Misanthrope <no@spam.net> wrote in message
news:ACv_5.10494$h67.676806@newsread1.prod.itd.earthlink.net...
> I've always taken it that Larry was talking about new language features
that
> Ada had introduced. The only thing I can think of that was new to Ada (so
> far as I know) and also exists in Perl is the "elsif" keyword. Most
> languages allow "else if", but Ada and Perl are the only languages I can
> think of with an "elsif".
The Bourne shell family has the very similar 'elif'
------------------------------
Date: Sun, 17 Dec 2000 16:59:03 +0100
From: Ole Christian Eidheim <eidheim@hivolda.no>
Subject: choosing which packages to use at run time
Message-Id: <3A3CE2C7.B6F244AB@hivolda.no>
Hi!
At run time I want my code to choose which class to use and create an
object of that class.
For instance:
my $class=shift;
use $class;
my $object=new $class(shift, shift);
The above code doesn't work of course, but is there a way to do this?
Thanks,
Ole Christian Eidheim
------------------------------
Date: 17 Dec 2000 17:29:17 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: choosing which packages to use at run time
Message-Id: <91it5c$49rm5$1@fu-berlin.de>
hi,
Ole Christian Eidheim <eidheim@hivolda.no> wrote:
> At run time I want my code to choose which class to use and create an
> object of that class.
> For instance:
> my $class=shift;
> use $class;
> my $object=new $class(shift, shift);
> The above code doesn't work of course, but is there a way to do this?
perldoc -f eval
hth,
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx
------------------------------
Date: Sun, 17 Dec 2000 13:25:43 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: choosing which packages to use at run time
Message-Id: <Pine.GSO.4.21.0012171324200.22284-100000@crusoe.crusoe.net>
[posted & mailed]
On Dec 17, Ole Christian Eidheim said:
>At run time I want my code to choose which class to use and create an
>object of that class.
>
>For instance:
>my $class=shift;
>use $class;
>my $object=new $class(shift, shift);
If you settle for require() instead of use, and direct method notation
instead of indirect, you can do:
require $class;
# $class->import; # probably not needed in your case
my $object = $class->new(@args);
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
PerlMonks - An Online Perl Community http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
------------------------------
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 5134
**************************************