Ask a Question related to PERL Miscellaneous, Design and Development.
-
Jay Tilton #1
Re: getting name of class and/or parent class that object belongs to
ed <coo_t2-NO-LIKE-SPAM@yahoo.com> wrote:
:
: Hey all. I'd like to convert some PHP code to Perl, but I'm not sure
: how to do it in Perl.
: The PHP method takes an argument which might be an error object.
:
: I have to figure the following about the argument:
: 1. If it's an object
: 2. If it's of class "apperror"
: 3. Alternatively if it's a subclass of "apperror"
You can satisfy all three requirements at once.
if( UNIVERSAL::isa($foo, 'apperror') ) {
print '$foo is an apperror object';
}
: The only part of the code below I know how to convert is the:
: get_class($e)=='apperror'
:
: In Perl I'd do:
: (ref $e)=='apperror'
:
: Right?
Nope.
The '==' operator compares in numerical context.
The 'eq' operator compares in string context.
You could do
if( ref($e) eq 'apperror' ) {
....
}
But that would check only whether $e is blessed into the apperror
class, not whether $e inherits from the apperror class.
Jay Tilton Guest
-
Reference to parent in license-enabled class constructor
I am using LicenseProvider to enable licensing for a web user control using C#. My license consists of a signed XML .lic file. Among other things,... -
#23038 [Com]: PHP does not detect parent class inside child class' constructor
ID: 23038 Comment by: hewei at ied dot org dot cn Reported By: black at sunshine dot krneki dot org Status: ... -
Extracting a parent class
----- Original Message ----- From: "Michael Garriss" <mgarriss@earthlink.net> To: "ruby-talk ML" <ruby-talk@ruby-lang.org> Sent: Thursday, July... -
Passing a method block to a parent class
If I have **** CODE **** class A def method1( argument ) yield( argument ) end end -
HowTo get a Viewstate Value from my Parent Class?
Hello, lets say I want to get from my Parent Class the viewstate("userID") How can I access this an get the value? Thanks for any help Andreas -
ed #2
Re: getting name of class and/or parent class that object belongs to
On Tue, 22 Jul 2003 22:14:30 GMT, [email]tiltonj@erols.com[/email] (Jay Tilton)
wrote:
Thanks.>
>You can satisfy all three requirements at once.
>
> if( UNIVERSAL::isa($foo, 'apperror') ) {
> print '$foo is an apperror object';
> }
>
I figured there was an easy way to do it.
Now I'm off to [url]http://www.perldoc.com/perl5.8.0/lib/UNIVERSAL.html[/url]
to find out _why_ it works :)
--ed
ed Guest
-
Tad McClellan #3
Re: getting name of class and/or parent class that object belongs to
ed <coo_t2-NO-LIKE-SPAM@yahoo.com> wrote:
> Now I'm off to [url]http://www.perldoc.com/perl5.8.0/lib/UNIVERSAL.html[/url]
Errr, why go way over there for it when it is already on
your very own hard disk?
Type:
perldoc UNIVERSAL
at a command line.
--
Tad McClellan SGML consulting
[email]tadmc@augustmail.com[/email] Perl programming
Fort Worth, Texas
Tad McClellan Guest
-
ed #4
Re: getting name of class and/or parent class that object belongs to
On Tue, 22 Jul 2003 19:12:22 -0500, [email]tadmc@augustmail.com[/email] (Tad
McClellan) wrote:
>ed <coo_t2-NO-LIKE-SPAM@yahoo.com> wrote:
>>>> Now I'm off to [url]http://www.perldoc.com/perl5.8.0/lib/UNIVERSAL.html[/url]
>
>Errr, why go way over there for it when it is already on
>your very own hard disk?
>
>
>
>Type:
>
> perldoc UNIVERSAL
>
>at a command line.
I'm using activestate perl on windows and for some reason perldoc
doesn't work from the command line. However the distro does come with
a windows version of the docs.
I'm gonna have to reinstall or upgrade and see if I can get perldoc
working from the command line.
--ed
ed Guest



Reply With Quote

