private-functions

How do I make private functions in a Perl module?

I am working on a little Perl module and for some reason I had the test driver script that was using my new module call one of the functions that I thought would be private, and it was successful. I was surprised, so I started searching google and I couldn't really find any documentation on how to make private functions in Perl modules....

Mocking problem, public function calling private function

Hi! I’m having a mocking problem. I know only public methods should be mocked. But what do I do when a private method is called in a public method, and this private method is getting data from a file? I want to mock this private method so I could go on in with the test of the public method. I could make this public to make the test wor...

Passing an array of data to a private function in CodeIgniter/PHP? [facepalm]

So I thought this should be easy, but, I'm n00bing out here and failing epicly (as they say on teh interwebz). So here's my code: function xy() { $array['var1'] = x; $array['var2'] = y; echo $this->_z; } function _z($array) { $xy = $x.$y; return $xy; } So, why doesn't that seemingly simple code work? I know with views you ...