Re: Class data and initialization

2002-02-04 Thread Jenda Krynicky
From: Peter Scott <[EMAIL PROTECTED]> > If you want to return the number of entries in the array, you'd need > to do > > sub num_get > { >my $what = pop; >eval "$#$what"; > } No need for eval. it doesn't hurt you this time since you are eval()ing a number ... the last

Re: Class data and initialization

2002-02-01 Thread Michael R. Wolf
[EMAIL PROTECTED] (Tarak Parekh) writes: > package A > > use strict; > > my @arr; > > sub new > { > my $classname = shift; > my $self = { > 'cfg_file' => undef, > @_, >}; > > # Mark it of the right type > bless ($self, $classna

Re: Class data and initialization

2002-02-01 Thread Peter Scott
At 02:41 PM 2/1/02 -0800, Tarak Parekh wrote: >Hello, > >I am trying to use Objects in Perl, and am having some basic problem. >I am sure I am missing something, but am not able to figure out what. > >--- > >package A > >use strict; Good. Lots of people don't bother to put this in modules. >my

Class data and initialization

2002-02-01 Thread Tarak Parekh
Hello, I am trying to use Objects in Perl, and am having some basic problem. I am sure I am missing something, but am not able to figure out what. --- package A use strict; my @arr; sub new { my $classname = shift; my $self = { 'cfg_file' => undef,