Hi, all,

I have a question about how to pass a hash in a method.  Below is the codes:

######MtvAnalysis.pm######

package MtvAnalysis;
use strict;
sub new
{
    ......
    $self->{'DCCC'} = [];
    ......
}

......

sub DCCC
{
    my $self = shift;
    if(@_) { %{$self->{'DCCC'}} = @_; }
    return %{$self->{'DCCC'}};
}

######main.pl######

Use MtvAnalysis

......

my $this = MtvAnalysis->new();
......
$this->DCCC();

There's an error when running main.pl: Not a HASH reference at 
MtvAnalysis.pm

Anyone has an idea where is wrong?  Thanks:-)

Best Regards,

Katherine Qiang


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to