May 23, 2013, 9:35 AM
Post #1 of 3
I have simply created one basic perl class and an object with attributes height and name.
Error when Object calls subroutine
there is one subroutine in class - calc.
When I try to call that method, the call doesn't take place. Here is the code below.
my $class = @_;
bless $self, $class;
print "hellloo more";
my $h =new par('rahim',23);
I get error as 'Can't locate object method calc via package '3' at par.pl line 29'
Any help shall be greatly appreciated. Can someone please tell me why it is wrong?
The same thing works in other program, but it fails to work here.