William Paoli wrote:
> $obj => {Title} =""; #Is this initilizing the
> attribute?

> I dont know why I am just not getting this stuff.
> Please help me.

your syntax is wrong, thats all.  so your assignment is make some kinda
rudimentary database lookup program thingie?  your program reads the file,
then accepts some kind of input to lookup info that was in the file?

honestly, i don't really know what the prof wants with this "attributes"
thing.  it seems to kinda confuse things for no reason, but whatever.

sub new {
my $self = {};
$self->{TITLE} = 'whatever title';
bless( $self );
return $self;
}

i don't know the specs for your project, but my constructor would probably
look like this:

sub new {
my ($caller, $filename) = @_;
my $class = ref($caller) || $caller;
my $self = {};
bless($self, $class);
$self->{TITLE} = 'My Title!';
$self->{FILENAME} = $filename;
parse_file($filename); # dunno, this might be $self->parse_file($filename)
return $self;
}

its kinda hard to help without knowing exactly how much you know about
perl...


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to