Shaun,<br> <br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If you don't need the robustness<br>of object oriented programming, you can skip the step of building
<br>an instance via a construcor (new()) and simply substitute the<br>pointer arrow (->) with colons (::). So for instance...<br><br>my $result_0 = Your::Procedural::function_0($var1, $var2);<br>my $result_1 = Your::Procedural::function_1($result_0);
</blockquote><div><br>Yes, certainly. I only alluded to it in my email, when I talked about procedural vs. object oriented Perl module programming. I avoided going into these details on it because they actually come out when you read the perlboot link that I sent.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The only caveat is that you will have to state the full module<br>name as part of the function call each time, just as above. This
<br>will get around having to shift off the package name, or blessed<br>instance as the case may be.</blockquote><div><br>Unless you start getting into importer/exporter stuff. But that, as they say, is another story. :-)
<br><br>Cheers,<br>Richard<br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">That said however, it's very much worthwhile to learn object
<br>oriented programming methodology and techniques. In the long run<br>this will make your code (especially larger applications) *much*<br>more maintainable and extensible. Understanding object<br>"inheritance" especially is extremely valuable, although I would
<br>caution you to learn what "multiple inheritance" is, and both<br>why and how to avoid it.<br><br>Good luck and happy reading. :)<br>--<br> Shaun Fryer<br><br>On Fri, Sep 07, 2007 at 12:20:29PM -0400, Madison Kelly wrote:
<br>> Hi all,<br>><br>> I am quite the module n00b, so please be gentle. :)<br>><br>> I've got a few small, simple modules I've written that handle some<br>> simple functions I use often. What I want to be able to do though is:
<br>><br>> my $foo=My::Module->new();<br>><br>> Then be able to call the function/subroutines in there like this:<br>><br>> my $value=$foo->function($var1, $var2);<br>><br>> I had tried to do:
<br>><br>> my $value=My::Module->function($var1, $var2);<br>><br>> But the first value picked up in the function is the module name... I<br>> don't think I should have to say in the module<br>>
<br>> sub function<br>> {<br>> my ($null, $var1, $var2)=@_;<br>> ...<br>> }<br>_______________________________________________<br>toronto-pm mailing list<br><a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org
</a><br><a href="http://mail.pm.org/mailman/listinfo/toronto-pm">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br></blockquote></div><br>