Dear All,

      I try to run a sampleclass example program
in perl. But I received error. How to avoid it?
The code is below:

Package Person;

sub new
     {
     my($type) = $_[0];
     my($self) = {};
     $self->{'name'} = $_[1];
     bless($self, $type);
     return($self);
     }

sub tellname
     {
     my($self)=$_[0];
     print "Person name is $self->{'name'}.\n";
     }

return(1);

Class calling program is below:
*******************************
se lib $ENV{"HOME"}."/perl";
print $ENV{"HOME"}."\n";
use Person;
$obj = Person->new('Prabahar');
$wr->tellname();

error report is below:
**********************

Can't locate Person.pm in @INC (@INC contains:
/Users/enmail/perl
/System/Links/Libraries/perl5/5.8.7/i686-linux
/System/Links/Libraries/perl5/5.8.7
/System/Links/Libraries/perl5
/System/Links/Libraries/perl5/site_perl/5.8.7/i686-linux
/System/Links/Libraries/perl5/site_perl/5.8.7
/System/Links/Libraries/perl5/site_perl
/Programs/Perl/5.8.7/lib/perl5/5.8.7/i686-linux
/Programs/Perl/5.8.7/lib/perl5/5.8.7
/Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7/i686-linux
/Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7
/Programs/Perl/5.8.7/lib/perl5/site_perl .) at
class_calling.pl line 3.
BEGIN failed--compilation aborted at class_calling.pl
line 3.
How I need to run this script.

regards
Prabahar


        

        
                
____________________________________________________
Send a rakhi to your brother, buy gifts and win attractive prizes. Log on to 
http://in.promos.yahoo.com/rakhi/index.html

-- 
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