 |
|
Home:
Perl Programming Help:
Beginner:
Re: [ChopperCharles] private and protected methods:
Edit Log
|
|

budman
User
Mar 29, 2012, 9:47 AM
Views: 7834
|
|
Re: [ChopperCharles] private and protected methods
|
|
|
Test your return values in test1.pl Success is 0, Fail is -1 - you were checking ret_code == 0
$ret_code = $t->__foo("Charles"); print "RC: $ret_code\n"; if ($ret_code != 0) { print "t->__foo(\"Charles\") failed.\n"; } Correct the " my $type = @_ " was actually getting the number of args and then using that number to bless the hash with. Changing it to " my ($type) = @_; " was correct. That should work for you now. What was the error for base and parent? Did you use it as follows: What version of perl are you using?
(This post was edited by budman on Mar 29, 2012, 9:54 AM)
|
|
|
Edit Log:
|
|
Post edited by budman
(User) on Mar 29, 2012, 9:48 AM
|
|
Post edited by budman
(User) on Mar 29, 2012, 9:49 AM
|
|
Post edited by budman
(User) on Mar 29, 2012, 9:54 AM
|
|
|  |