Re: OOP in Perl

2008-02-16 Thread Randal L. Schwartz
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes: "Jeff> but the second one is recommended, it looks more like the OO way. It's more than just recommended. The indirect object form is actively discouraged, because we've been finding more and more examples where the inherent imbiguity in i

Re: OOP in Perl

2008-02-16 Thread Jeff Pang
On Feb 15, 2008 11:56 PM, howa <[EMAIL PROTECTED]> wrote: > Hi, > > Currently I have seen two way to create objects in Perl: > > 1. my $a = new Apple... > 2. my $a = Apple->new(); > > What are the differences, and which one is recommended? > Both are fine: $ perl -le 'package A;sub new{print shif

OOP in Perl

2008-02-16 Thread howa
Hi, Currently I have seen two way to create objects in Perl: 1. my $a = new Apple... 2. my $a = Apple->new(); What are the differences, and which one is recommended? Thanks. Howard. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

Questions of OOP in Perl

2003-08-14 Thread Pablo Fischer
Hi! I have some questions about OOP in Perl. 1. In my class I have lot of methods, but some of them just parse a file or pass a string to a different format (like in C, Im thinking that they are private), In perl, whats the better way to call a private method: $state = $this->city2state(&q

Re: Questions of OOP in Perl

2003-08-14 Thread R. Joseph Newton
Pablo Fischer wrote: > Thanks! > > After sending my question I found in a website the topic of 'private' methods, > and shows code like this: > > my $method_name = sub { > my $this = shift; > > _blablabla_ > }; > > And to access it : > > $this->$method_name("Arg1"); > > Now, this it really

Re: Questions of OOP in Perl

2003-08-14 Thread Tassilo von Parseval
On Fri, Aug 08, 2003 at 12:05:47AM + Pablo Fischer wrote: > I have some questions about OOP in Perl. > > 1. In my class I have lot of methods, but some of them just parse a file or > pass a string to a different format (like in C, Im thinking that they are > private), In

Re: Questions of OOP in Perl

2003-08-14 Thread James Edward Gray II
On Wednesday, August 13, 2003, at 12:34 AM, R. Joseph Newton wrote: Pablo Fischer wrote: Thanks! After sending my question I found in a website the topic of 'private' methods, and shows code like this: my $method_name = sub { my $this = shift; _blablabla_ }; And to access it : $this-

Re: Questions of OOP in Perl

2003-08-09 Thread Pablo Fischer
Thanks! After sending my question I found in a website the topic of 'private' methods, and shows code like this: my $method_name = sub { my $this = shift; _blablabla_ }; And to access it : $this->$method_name("Arg1"); Now, this it really works for 'private' methods? Thanks! -- Pa