From: "Tom Phoenix" <[EMAIL PROTECTED]>
> On 6/4/07, GMan <[EMAIL PROTECTED]> wrote:
> Things go smoothly for a while, and things seem quiet. Too quiet. Then...
>
> > sub addfriend {
> > my ($self,$f) = @_;
> > #dereference the array from the hash
> > $fr = $self->{'_friends'};
> >
On Jun 4, 4:34 pm, [EMAIL PROTECTED] (GMan) wrote:
> I am trying to teach myself Perl Objects.
>
> I have a Person object with a name and a list of friends.
>
> Here is a test program that uses it.
>
> #! /usr/bin/perl
>
> use Person;
>
> $p = new Person;
>
> $p->setname("Gary");
> $p->addfriend("B
On Jun 4, 4:34 pm, [EMAIL PROTECTED] (GMan) wrote:
> I am trying to teach myself Perl Objects.
>
> I have a Person object with a name and a list of friends.
>
> Here is a test program that uses it.
>
> #! /usr/bin/perl
>
> use Person;
>
> $p = new Person;
>
> $p->setname("Gary");
> $p->addfriend("B
GMan wrote:
> I am trying to teach myself Perl Objects.
>
> I have a Person object with a name and a list of friends.
>
> Here is a test program that uses it.
>
> #! /usr/bin/perl
>
> use Person;
>
> $p = new Person;
>
> $p->setname("Gary");
> $p->addfriend("Bill");
> $p->addfriend("John");
> $p-
On 6/4/07, GMan <[EMAIL PROTECTED]> wrote:
sub new {
my ($class) = @_;
my ($self) = { };
bless $self, $class;
$self->{'_name'} = "";
@friends = { };
Wait, what was that? Where did this @friends variable come from? It
should probably be a 'my' variable; if you have 'use stri
I am trying to teach myself Perl Objects.
I have a Person object with a name and a list of friends.
Here is a test program that uses it.
#! /usr/bin/perl
use Person;
$p = new Person;
$p->setname("Gary");
$p->addfriend("Bill");
$p->addfriend("John");
$p->print();
Here is the output from the t