Re: perlapi overrides system read()/ioctl() methods

2016-05-12 Thread Uri Guttman
On 05/12/2016 04:15 PM, Timothy Madden wrote: Hello I am trying to write an extension module (uses native C code) and I notice after including , that POSIX read() function is now overriden by a Perl macro. Can I find this explained somewhere please ? Is it safe to ignore ? Should I #undef

perlapi overrides system read()/ioctl() methods

2016-05-12 Thread Timothy Madden
Hello I am trying to write an extension module (uses native C code) and I notice after including , that POSIX read() function is now overriden by a Perl macro. Can I find this explained somewhere please ? Is it safe to ignore ? Should I #undef it, or should I create a separate .c file without ju

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-07 Thread Shawn H Corey
r than double-quotes being two characters shorter)? > > For example, is it "faster" for Perl to parse a double-quoted > > string or does the compiler optimise this out so the methods are > > fundamentally equivalent? > > > In that regards you can get a r

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Uri Guttman
example, is it "faster" for Perl to parse a double-quoted string or does the compiler optimise this out so the methods are fundamentally equivalent? In that regards you can get a reasonable look at how perl interprets your string with B::Deparse, partly because the deparse reversal sho

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Kent Fredric
er" > for Perl to parse a double-quoted string or does the compiler optimise > this out so the methods are fundamentally equivalent? In that regards you can get a reasonable look at how perl interprets your string with B::Deparse, partly because the deparse reversal shows it more "nati

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Paul Johnson
On Wed, Apr 06, 2016 at 08:20:24PM +0100, Jonathon Fernyhough wrote: > Hi, > > I'm working my way through Learning Perl (6th) and Modern Perl (4th) and > was wondering whether there are any (non-obvious) drawbacks to the > different string quoting methods. > > First

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Shawn H Corey
On Wed, 6 Apr 2016 15:29:26 -0400 Uri Guttman wrote: > my rule is for the reader and not the computer. i try to use '' when > i know there is no interpolation and "" when there is. i am telling > the reader to either not look or to look inside the string. PBP recommends that yo use q{} for singl

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Uri Guttman
On 04/06/2016 03:20 PM, Jonathon Fernyhough wrote: Hi, I'm working my way through Learning Perl (6th) and Modern Perl (4th) and was wondering whether there are any (non-obvious) drawbacks to the different string quoting methods. First up, double-quoted strings. The "usual method&

Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Jonathon Fernyhough
Hi, I'm working my way through Learning Perl (6th) and Modern Perl (4th) and was wondering whether there are any (non-obvious) drawbacks to the different string quoting methods. First up, double-quoted strings. The "usual method" of double-quoting has an alternative of qq{Fo

Re: How Can I find all kinds of methods a Object support?

2012-04-13 Thread Zapp
Finally, It's work! Thanks ! 于 2012-4-12 20:11, Michael Rasmussen 写道: On Thu, Apr 12, 2012 at 06:29:09PM +0800, Zapp wrote: I had try it, codes is here: #!/usr/local/bin/perl -w use Class::Inspector; use IO::File; my @methods = Class::Inspector->methods('IO::File', 'f

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Peter Scott
On Wed, 11 Apr 2012 16:12:22 +0800, Zapp wrote: > How Can I find all kinds of methods a Object support? For example: > > my $fh = IO::File->new("/path/to/file"); > > how manny kinds of methods does the $fh have ? > > I try perldoc IO::File , but didn't fin

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Michael Rasmussen
On Thu, Apr 12, 2012 at 06:29:09PM +0800, Zapp wrote: > I had try it, codes is here: > > #!/usr/local/bin/perl -w > > use Class::Inspector; > use IO::File; > > my @methods = Class::Inspector->methods('IO::File', 'full', 'public'); > &g

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Shlomi Fish
Hi Zapp, On Thu, 12 Apr 2012 18:29:09 +0800 Zapp wrote: > I had try it, codes is here: > > #!/usr/local/bin/perl -w > > use Class::Inspector; > use IO::File; > > my @methods = Class::Inspector->methods('IO::File', 'full', 'public');

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Zapp
I had try it, codes is here: #!/usr/local/bin/perl -w use Class::Inspector; use IO::File; my @methods = Class::Inspector->methods('IO::File', 'full', 'public'); print "@methods"; but it Only print this: ARRAY(0xaa4bc8) Why? 于 2012-4-11 20:34, Shl

Re: How Can I find all kinds of methods a Object support?

2012-04-11 Thread Shlomi Fish
Hi Zapp, On Wed, 11 Apr 2012 16:12:22 +0800 Zapp wrote: > How Can I find all kinds of methods a Object support? > For example: > > my $fh = IO::File->new("/path/to/file"); > > how manny kinds of methods does the $fh have ? > > I try perldoc IO::File ,

Re: How Can I find all kinds of methods a Object support?

2012-04-11 Thread 'lesleyb'
On Wed, Apr 11, 2012 at 04:12:22PM +0800, Zapp wrote: > How Can I find all kinds of methods a Object support? > For example: > > my $fh = IO::File->new("/path/to/file"); > > how manny kinds of methods does the $fh have ? > > I try perldoc IO::File , but di

How Can I find all kinds of methods a Object support?

2012-04-11 Thread Zapp
How Can I find all kinds of methods a Object support? For example: my $fh = IO::File->new("/path/to/file"); how manny kinds of methods does the $fh have ? I try perldoc IO::File , but didn't find what I want. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addi

Re: Calling all methods (URGENT)

2010-10-12 Thread Brian Fraser
If I understood you correctly, you want to see all the methods from a series of .pm files, right? I see two ways to do this: First, you could simply read the files manually, finding any lines that have 'sub' followed by a valid name (to avoid anonymous subroutines); since methods are su

Re: Calling all methods (URGENT)

2010-10-11 Thread Shlomi Fish
Hi Jyoti, On Monday 11 October 2010 16:44:38 Jyoti wrote: > Hello All, > > I need an urgent help. > I have got .pm files in a directory. All .pm files have subroutines with > different methods. At present, I am getting an output of list of all .pm > files. > But I want i

Calling all methods (URGENT)

2010-10-11 Thread Jyoti
Hello All, I need an urgent help. I have got .pm files in a directory. All .pm files have subroutines with different methods. At present, I am getting an output of list of all .pm files. But I want it to take all methods from all .pm files and give and output with all the subroutine (methods

Re: how to choose multiplexing methods in perl

2009-07-14 Thread Jenn G.
On Wed, Jul 15, 2009 at 10:38 AM, XUFENG wrote: > Hi all, > I use IO::Socket::INET to program server-client communication.When trying to > serve some concurrency,I have some options: >        1, multi-threading >        2, one daemon process with IO::Epoll > which is better? Nothing is absolute b

how to choose multiplexing methods in perl

2009-07-14 Thread XUFENG
Hi all, I use IO::Socket::INET to program server-client communication.When trying to serve some concurrency,I have some options: 1, multi-threading 2, one daemon process with IO::Epoll which is better? -- XUFENG 2009-07-15 -- To unsu

Re: finding methods and attributes in a name space

2007-08-31 Thread Chas Owens
On 8/31/07, Hunter Barrington <[EMAIL PROTECTED]> wrote: > how would i find out what attributes and methods are in a name space? > for example i have an object in my code and im not sure what type it is, > what attributes are associated with it, what methods etc etc how can i > f

finding methods and attributes in a name space

2007-08-31 Thread Hunter Barrington
how would i find out what attributes and methods are in a name space? for example i have an object in my code and im not sure what type it is, what attributes are associated with it, what methods etc etc how can i find out. in python there was dir() and type() which was a big help. anything

Re: Understanding methods OO Perl

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 5, 1:17 am, [EMAIL PROTECTED] (Chas Owens) wrote: > On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > snip> Horse->speak; > snip > > What I'm having trouble understanding is how $class is passed the > > argument "Horse" when I don't explicitly pass Horse as a parameter to > > speak.

Re: Understanding methods OO Perl

2007-06-05 Thread Dean
On Jun 5, 1:24 am, [EMAIL PROTECTED] (Tom Phoenix) wrote: > On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > What I'm having trouble understanding is how $class is passed the > > argument "Horse" when I don't explicitly pass Horse as a parameter to > > speak. > > It's automatic when yo

Re: Understanding methods OO Perl

2007-06-04 Thread Tom Phoenix
On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: What I'm having trouble understanding is how $class is passed the argument "Horse" when I don't explicitly pass Horse as a parameter to speak. It's automatic when you use the method syntax. If you called a subroutine in the normal way, pe

Re: Understanding methods OO Perl

2007-06-04 Thread Chas Owens
On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip Horse->speak; snip What I'm having trouble understanding is how $class is passed the argument "Horse" when I don't explicitly pass Horse as a parameter to speak. snip Ah, but you are. Horse->speak is passing Horse to speak. You ca

Understanding methods OO Perl

2007-06-04 Thread [EMAIL PROTECTED]
Hi... I've been going through Learning Perl Objs, Ref & Mods and I'm having a some trouble with method invocation. The example codes below: { package Animal; sub speak{ my $class = shift; print "a $class goes ", $class->sound, "!\n"; } } {

Re: 2 modules share each other's methods, is that safe ?

2007-02-22 Thread Mug
Hi and thanks Sutton, > Igor Sutton wrote: > Hi Mug, > > package PackA; > > sub new { > my ($class) = @_; > my $self = {}; > bless $self, $class; > my $self->{B} = PackB->new($self); > return $self; > } > > package PackB; > > sub new { > my ($class, $packA_ref) = @_; > my $self = { > A => $packA_re

Re: 2 modules share each other's methods, is that safe ?

2007-02-22 Thread Igor Sutton
Hi Mug, 2007/2/22, Mug <[EMAIL PROTECTED]>: Hello List, My question is if this work safe ? Here I have the way to use 2 modules and shares their methods cross along, because I don't want to split out the common part as another package, since there are class properties inside. If

2 modules share each other's methods, is that safe ?

2007-02-21 Thread Mug
Hello List, My question is if this work safe ? Here I have the way to use 2 modules and shares their methods cross along, because I don't want to split out the common part as another package, since there are class properties inside. If I split out something, I have to rebuild the object aga

Re: Re: using XS for calling exported methods from a DLL

2005-10-14 Thread Bernard Kenik
- Original Message - From: "Beau E. Cox" <[EMAIL PROTECTED]> To: "Bernard Kenik" <[EMAIL PROTECTED]> Cc: "Beginners Perl" Sent: Friday, October 14, 2005 1:29 PM Subject: Re: Re: using XS for calling exported methods from a DLL Hi Bernard et

Re: using XS for calling exported methods from a DLL

2005-10-14 Thread Bernard Kenik
- Original Message - Sent: Friday, October 14, 2005 12:24 PM If you want the complete module to copy/study/etc., let me know and I will send it to you off-list. Aloha => Beau; [EMAIL PROTECTED] 2005-10-14 Please send it to me also. I am trying to use a function from a dll. It has

Re: using XS for calling exported methods from a DLL

2005-10-14 Thread Beau E. Cox
Hi Sam- At 2005-10-14, 00:05:10 you wrote: >Hi > >Is there a way to call exported methods from a DLL without using win32::API. > >Has anyone tried calling an exported function from C DLL in a Perl Program >using XS. > [snipped] YES! First, your error is caused becaus

using XS for calling exported methods from a DLL

2005-10-14 Thread sam joseph
Hi Is there a way to call exported methods from a DLL without using win32::API. Has anyone tried calling an exported function from C DLL in a Perl Program using XS. I have a C DLL's source file and its header file and using h2xs D:\DLLProjects\simpledll3>h2xs -n ext2 simpledll3.h

RE: Spam:RE: Return values from methods on Classes/Objects

2004-11-29 Thread Michael Kraus
G'day! > : Clearly, I'm missing something crucial here... :) > > And so are we. Like the code for the method for > format_cost(), but I imagine that you are not shifting the > object off at the beginning of that subroutine. Right you are... :) Btw... The code was: sub format_cost {

RE: Return values from methods on Classes/Objects

2004-11-29 Thread Charles K. Clarkson
Michael Kraus <[EMAIL PROTECTED]> wrote: : One of my classes has a method called format_cost which takes a : number (integer representing a monetory amount in cents) and : pretties it up for : display as a dollar amount. I.e. format_cost(12) returns : "$1,200.00". : : When I have the functio

Return values from methods on Classes/Objects

2004-11-28 Thread Michael Kraus
G'day... One of my classes has a method called format_cost which takes a number (integer representing a monetory amount in cents) and pretties it up for display as a dollar amount. I.e. format_cost(12) returns "$1,200.00". When I have the function stand-alone it behaves as it should, however

Re: Overridden methods

2004-11-27 Thread Michael S. E. Kraus
G'day Bob and all... :) > Your class is not an abstract class in this sense, as you can instantiate > objects of the class. This is the meaning that I have always used (coming > from C++). Ahh... but not if you can't run the method to instantiate it... :) (or at least it not returning a valid o

Re: Overridden methods

2004-11-25 Thread Bob Showalter
Bob Showalter wrote: Michael Kraus wrote: > "A class that cannot have direct instances. The opposite of an > abstract class is a concrete class." Your class is not an abstract class in this sense, as you can instantiate objects of the class. This is the meaning that I have always used (coming from

Re: Overridden methods

2004-11-25 Thread Bob Showalter
Michael Kraus wrote: G'day... Firstly ***thanks*** to everyone who has been helping me with this Really appreciated... Now, for friendly arguments sake... > > I'm wanting to write a method in an abstract class that must be > > overriden by it's children. If it is called directly (i.e. without >

Re: Overridden methods

2004-11-25 Thread Michael S. E. Kraus
G'day Paul... Nice to see another Evolution user... :) > It's a more advanced question than most, but not inappropriate for this > list, I think. You may also wish to consider comp.lang.perl.misc or > perlmonks for further insight. Thanks for that... :) > But you should also consider that man

Re: Overridden methods

2004-11-24 Thread Todd W
"Michael S. E. Kraus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Am I asking to higher a level a question to be appropriate for this > list? > > Thanks... > > -Mike I saw this browsing CPAN the other day... yep: http://search.cpan.org/~mschwern/Class-Virtual-0.04/ Hopefully t

RE: Overridden methods

2004-11-24 Thread Michael Kraus
G'day... Firstly ***thanks*** to everyone who has been helping me with this Really appreciated... Now, for friendly arguments sake... > > I'm wanting to write a method in an abstract class that must be > > overriden by it's children. If it is called directly (i.e. without > > being overrid

RE: Overridden methods

2004-11-24 Thread Bob Showalter
Bob Showalter wrote: >sub foo { >my $self = shift; >my $class = ref $self; >if ($class->can('foo') eq \&foo) { Oops, this should be $self->can, not $class->can >print "$class does not override foo\n"; >} >else { >print "$class ov

RE: Overridden methods

2004-11-24 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > In article > <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Bob Showalter) writes: > > Michael Kraus wrote: > > > I'm wanting to write a method in an abstract class that must be > > > overriden by it's children. If it is called directly (i.e. without > > > being overriden) t

RE: Overridden methods

2004-11-24 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bob Showalter) writes: >Michael Kraus wrote: >> I'm wanting to write a method in an abstract class that must be >> overriden by it's children. If it is called directly (i.e. without >> being overriden) then it registers an error, but if its called

Re: Overridden methods

2004-11-24 Thread Jenda Krynicky
From: "Michael Kraus" <[EMAIL PROTECTED]> > If a sublass has overrides a method in a superclass, and the > subclasses method calls the superclass's method, is there any > mechanism to detect that the superclass' method has been overridden? > > > I'm wanting to write a method in an abstract class

Re: Overridden methods

2004-11-24 Thread JupiterHost.Net
to examine my classes to discover how to test for it myself. Is it possible to confirm this? Since you are writing these methods (and hence controlling the paradigm) I'd add variables to your object when you over ride it like $obj->{got_override} = 'package::version'; then

Re: Overridden methods

2004-11-24 Thread Paul Johnson
ensuring that an object of the superclass type cannot be created should be sufficient. This can be done fairly simply by checking that the first argument to your constructor is not the name of the superclass. Further checks in the superclass methods are possible though there are normally super

RE: Overridden methods

2004-11-24 Thread Bob Showalter
Michael Kraus wrote: > If a sublass has overrides a method in a superclass, and the > subclasses method calls the superclass's method, is there any > mechanism to detect that the superclass' method has been overridden? > > > I'm wanting to write a method in an abstract class that must be > overri

Re: Overridden methods

2004-11-24 Thread Michael S. E. Kraus
Am I asking to higher a level a question to be appropriate for this list? Thanks... -Mike On Wed, 2004-11-24 at 17:35, Michael Kraus wrote: > G'day... > > If a sublass has overrides a method in a superclass, and the subclasses > method calls the superclass's method, is there any mechanism to de

Overridden methods

2004-11-23 Thread Michael Kraus
G'day... If a sublass has overrides a method in a superclass, and the subclasses method calls the superclass's method, is there any mechanism to detect that the superclass' method has been overridden? I'm wanting to write a method in an abstract class that must be overriden by it's children. If

Re: Learning Objects, destroy methods

2004-01-07 Thread Gary Stainburn
On Tuesday 06 January 2004 6:09 pm, Randal L. Schwartz wrote: > > "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: > > Gary> My idea is to keep only the %_BLOCKS as a strong ref and weaken > Gary> all others. That way, I can guarantee that when I delete that > Gary> ref the object will be

Re: Learning Objects, destroy methods

2004-01-06 Thread Randal L. Schwartz
> "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: Gary> My idea is to keep only the %_BLOCKS as a strong ref and weaken Gary> all others. That way, I can guarantee that when I delete that Gary> ref the object will be destroyed. I do believe you want it the other way around. -- Randal

Re: Learning Objects, destroy methods

2004-01-06 Thread Gary Stainburn
On Tuesday 06 Jan 2004 2:08 pm, Dan Anderson wrote: > I don't know if anybody has mentioned it yet, but check out weak > references on CPAN: > > http://search.cpan.org/~lukka/WeakRef-0.01/WeakRef.pm > > -Dan Thanks Dan, Although, based on experience and responses from this thread I don't think t

Re: Learning Objects, destroy methods

2004-01-06 Thread Dan Anderson
I don't know if anybody has mentioned it yet, but check out weak references on CPAN: http://search.cpan.org/~lukka/WeakRef-0.01/WeakRef.pm -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
irect references to any object or its member. For instance, once a Trainset is created, you would want to access inidividual Tracks only through the Trainset methods, and let it find and interact with the appropriate track. One strategy would be to return the index of any track created, and have acces

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
ner. Generally you would want to avoid having > other references to the contained objects, except through the methods of the > container [Trainset] object. > > package Trainset; > > use strict, warnings et. al.; use Trian; > > > use Exporter; > > our @ISA = qw/Eport

Re: Learning Objects, destroy methods

2004-01-05 Thread Randal L. Schwartz
> "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: Gary> I create a new track block such: Gary> my $T1=Trainset->track('T1','Block'); Gary> This also created $Trainset::_BLOCKS{T1} which references the object. Gary> My problem is how can I destroy the object when I no longer want it? Y

Re: Learning Objects, destroy methods

2004-01-05 Thread R. Joseph Newton
fficient, > or will this still tie up memory? Is there a better way? > > -- > Gary Stainburn Overall, I would suggest that you steer clear of internal references in your objects when possible. It is much better to make a container class, then delete contained objects from the container.

Re: Learning Objects, destroy methods

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > On Monday 05 January 2004 3:12 pm, Rob Dixon wrote: > > Gary Stainburn wrote: > [snip] > > > sufficient, or will this still tie up memory? Is there a better way? > > > > Hi Gary. > > > > We really need to see your

Re: Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 3:12 pm, Rob Dixon wrote: > Gary Stainburn wrote: [snip] > > sufficient, or will this still tie up memory? Is there a better way? > > Hi Gary. > > We really need to see your 'delete' and 'DESTROY' methods. But you can get > a

Re: Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 2:09 pm, Dan Anderson wrote: > > My problem is one of destroying a block (object), making sure that I have > > no memory leakage. > > Out of curiosity, when you say memory leakage do you mean that the > memory persists after the Perl process exits, or just while it is > ru

Re: Learning Objects, destroy methods

2004-01-05 Thread Rob Dixon
ere. Is there and way to ensure that the object is > destroyed - i.e. force the refcount to zero? > > The only solution I've come up with is to explicitly call DESTROY from within > the delete function, and within DESTROY empty the hash. Is this sufficient, > or will this s

Re: Learning Objects, destroy methods

2004-01-05 Thread Dan Anderson
> My problem is one of destroying a block (object), making sure that I have no > memory leakage. Out of curiosity, when you say memory leakage do you mean that the memory persists after the Perl process exits, or just while it is running? And have you verified this? And, is the program a daemon

Learning Objects, destroy methods

2004-01-05 Thread Gary Stainburn
Hi folks, My first forrey into Perl objects sees me trying to model a railway. I've got a hash of named blocks of track, which is added to when I create a new block object. My problem is one of destroying a block (object), making sure that I have no memory leakage. I create a new track block

Re: invoking sub/methods shortcut

2003-10-03 Thread Hardy Merrill
Steve Piner [EMAIL PROTECTED] wrote: > On Thu, 2 Oct 2003 00:10:57 -0700 (PDT), <[EMAIL PROTECTED]> wrote: > > >both of these works: > > > >>> return (getVUser($dbh,$u,$d))->rows(); > >and > >return getVUser($dbh,$u,$d)->rows(); > > The first version works, but I'd recommend avoiding it as it

Re: invoking sub/methods shortcut

2003-10-03 Thread Steve Piner
On Thu, 2 Oct 2003 00:10:57 -0700 (PDT), <[EMAIL PROTECTED]> wrote: both of these works: return (getVUser($dbh,$u,$d))->rows(); and return getVUser($dbh,$u,$d)->rows(); The first version works, but I'd recommend avoiding it as it suggests that the following should work similarly - but it do

Re: invoking sub/methods shortcut

2003-10-02 Thread Jason E. Stewart
"John W. Krahn" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > > > Can I do something like this? > > from > > $sth = getVUser($dbh, $u, $d); > > return $sth->rows(); > > to > > return (getVUser($dbh,$u,$d))->rows(); I find this more readable return getVUser($dbh,$u,$d)->rows();

Re: invoking sub/methods shortcut

2003-10-02 Thread perl
both of these works: >> return (getVUser($dbh,$u,$d))->rows(); and return getVUser($dbh,$u,$d)->rows(); -rkl > [EMAIL PROTECTED] wrote: >> >> Can I do something like this? >> from >> $sth = getVUser($dbh, $u, $d); >> return $sth->rows(); >> to >> return (getVUser($dbh,$u,$d))->rows(); >

Re: invoking sub/methods shortcut

2003-10-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Can I do something like this? > from > $sth = getVUser($dbh, $u, $d); > return $sth->rows(); > to > return (getVUser($dbh,$u,$d))->rows(); What happened when you tried it? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

invoking sub/methods shortcut

2003-10-01 Thread perl
Can I do something like this? from $sth = getVUser($dbh, $u, $d); return $sth->rows(); to return (getVUser($dbh,$u,$d))->rows(); a move from java->perl ;) thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

how do i list the methods connected to a object?

2003-08-14 Thread Martin A. Hansen
hi i wonder how i can list all the methods availible from a given object? martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Dan Muey
> On Thu, Aug 07, 2003 at 11:28:10AM -0500, Dan Muey wrote: > >> Yeah. The 'return' keyword can even be left out. > > > > Nice! I'll leave it in for readability I think. > > > > Wouldn't it need a ';' at the end? > > [ grep .. ]; > > > > Or am I once again missing something I should know? >

SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Martin A. Hansen
problem solved: given an arbitrary object, i can now get a dump of all the functions connected to the object. print &dump_functions( $obj ); sub dump_functions { use Data::Dumper; use Class::Inspector; my ( $obj ) = @_; my ( $ref, $methods, @methods ); $ref =

Re: how do i list the methods connected to a object?

2003-08-14 Thread Rob Dixon
"Martin A. Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi > > i wonder how i can list all the methods availible from a given object? If you only need this for debugging, then the debugger will do it for you. Stop at point where the object i

Re: SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Jeff 'japhy' Pinyan
;my ( $obj ) = @_; > >my ( $ref, $methods, @methods ); You never use @methods. >$ref = ref $obj; >$methods = Class::Inspector->methods( $ref, 'full', 'public' ); > > @{ $methods } = grep /$ref/, @{ $methods }; >return Dumper( $

RE: SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Dan Muey
> >sub dump_functions { > >use Class::Inspector; > >my $r = ref $_[0]; > >return [ grep /^$r/, @{ > >Class::Inspector->methods($r,'full','public')} ] } > > Yeah. The 'return' keyword can even be left out. Nice!

Re: how do i list the methods connected to a object?

2003-08-14 Thread Ovid
--- Peter Scott <[EMAIL PROTECTED]> wrote: > >The problem here is that it will not print inherited or AUTOLOADed methods. > [snip] > > So traverse the inheritance hierarchy and do the same thing with each class: > > http://search.cpan.org/author/SBURKE/Class-ISA-0.32

Re: how do i list the methods connected to a object?

2003-08-14 Thread Martin A. Hansen
t;[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > > --- Peter Scott <[EMAIL PROTECTED]> wrote: > > > > > >The problem here is that it will not print inherited or AUTOLOADed methods. > > > > > [snip] > > > > > > > >

Re: how do i list the methods connected to a object?

2003-08-14 Thread Martin A. Hansen
value $eval" ); print "\n"; } } ######## On Tue, Aug 05, 2003 at 05:48:04AM -0700, Ovid wrote: > --- "Martin A. Hansen" <[EMAIL PROTECTED]> wrote: > > hi > > > > i wond

RE: SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Dan Muey
Cool! 1 quick question why do you have @methods? If it's because you use @{ $methods } then $methods would have to be the string 'methods' to be a reference to @methods, which doesn't have any data as far as I can tell. Maybe I'm missing something? Dan > p

RE: SOLVED: how do i list the methods connected to a object?

2003-08-14 Thread Jeff 'japhy' Pinyan
On Aug 7, Dan Muey said: >So would this return the methods that the $obj sent to dump_functions >then, only shorter? > >sub dump_functions { >use Class::Inspector; >my $r = ref $_[0]; >return [ grep /^$r/, @{ Class::Inspector->methods($r,'full',&

Re: how do i list the methods connected to a object?

2003-08-11 Thread Steve Grazzini
s a simple one (pay no attention to the symrefs). package UNIVERSAL; sub methods { my $class = ref($_[0]) || $_[0]; if ($class eq 'GLOB') { $class = ref *{$_[0]}{IO}; } my @stack = ('UNIVERSAL', $class); my (@meth, %see

Re: SOLVED: how do i list the methods connected to a object?

2003-08-11 Thread Martin A. Hansen
On Thu, Aug 07, 2003 at 09:01:57AM -0500, Dan Muey wrote: > > Cool! 1 quick question why do you have @methods? sorry old remnant. just delete. martin > If it's because you use @{ $methods } then $methods would have to be the string > 'methods' to be a reference to @

Re: how do i list the methods connected to a object?

2003-08-11 Thread Rob Dixon
[EMAIL PROTECTED]> wrote: > > > > >The problem here is that it will not print inherited or AUTOLOADed methods. > > > > [snip] > > > > > > > > So traverse the inheritance hierarchy and do the same thing with each class: > > > > >

Re: how do i list the methods connected to a object?

2003-08-10 Thread Rob Dixon
"Ovid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > --- Peter Scott <[EMAIL PROTECTED]> wrote: > > >The problem here is that it will not print inherited or AUTOLOADed methods. > > [snip] > > > > So traverse the inherit

Re: how do i list the methods connected to a object?

2003-08-08 Thread Ovid
--- "Martin A. Hansen" <[EMAIL PROTECTED]> wrote: > hi > > i wonder how i can list all the methods availible from a given object? > > martin Hi Martin, The simple answer: You can't. Welcome to Perl. The long answer: there are a variety of strategies you

RE: SOLVED: how do i list the methods connected to a object?

2003-08-08 Thread Dan Muey
Dumper; > >use Class::Inspector; > > > >my ( $obj ) = @_; > > > >my ( $ref, $methods, @methods ); > > You never use @methods. > > >$ref = ref $obj; > >$methods = Class::Inspector->methods( $ref, 'full', &#x

RE: SOLVED: how do i list the methods connected to a object?

2003-08-07 Thread Perry, Alan
On Thursday, August 07, 2003 11:28, Dan Muey wrote: >>>sub dump_functions { >>>use Class::Inspector; >>>my $r = ref $_[0]; >>>return [ grep /^$r/, @{ >>>Class::Inspector->methods($r,'full','public')} ] } >> &

Re: how do i list the methods connected to a object?

2003-08-06 Thread Rob Dixon
Jenda Krynicky wrote: > > Guess what methods does this object support ;-) > > package Len; > > sub new { > my $self; > bless \$self, 'Len'; > } > > sub AUTOLOAD { > $AUTOLOAD =~ s/^.*:://; > return length($AUTOLOAD); > } Nice one Jend

Re: how do i list the methods connected to a object?

2003-08-06 Thread Jenda Krynicky
an't prevent the module authors to be creative with autoloading and autodefinig. Guess what methods does this object support ;-) package Len; sub new { my $self; bless \$self, 'Len'; }

Re: how do i list the methods connected to a object?

2003-08-06 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Ovid) writes: >--- "Martin A. Hansen" <[EMAIL PROTECTED]> wrote: >> i wonder how i can list all the methods availible from a given object? > >The simple answer: You can't. Welcome to Perl. > >The

Re: how do i list the methods connected to a object?

2003-08-06 Thread Martin A. Hansen
On Tue, Aug 05, 2003 at 08:18:24PM +0100, Rob Dixon wrote: > > "Ovid" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > --- Peter Scott <[EMAIL PROTECTED]> wrote: > > > >The problem here is that it will not print inherited or AUTOLOADed

Re: methods

2003-07-21 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: >Hi all, > >Whats the difference between class methods and instance methods on perl ? In any language, the difference between an instance method and a class method is that an instance method operates on an instance and

RE: methods

2003-07-21 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi all, > > Whats the difference between class methods and instance methods on > perl ? A class method can be called without reference to a specific instance. Any data it accesses is global. Constructors are class methods. An instance method accesses memb

Re: methods

2003-07-19 Thread Jeff 'japhy' Pinyan
On Jul 19, [EMAIL PROTECTED] said: >Whats the difference between class methods and instance methods on perl ? Syntactically, nothing. In fact, if you see method $foo @args; or $foo->method(@args); you can't be sure whether it's a class method or an instance method bei

Re: methods

2003-07-19 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Hi all, Whats the difference between class methods and instance methods on perl ? Simply put from perltoot: "More often than not, the class provides the user with little bundles. These bundles are objects. They know whose class they belong to, and how to b

  1   2   >