<div dir="ltr">Well, when you have to call a method defined later in the source file you have to use '&' or use the brackets. Example:<br><br>package foo;<br><br>sub my_method {<br> my $b = some_method;<br>}<br>
sub some_method {<br> return "something";<br>}<br><br>The above will fail, Perl will think of "some_method" as just another bare word. But if you write:<br><br>my $b = &some_method; <br>or<br>my $b = some_method();<br>
<br>everything will work. Of course, you can also define some_method before my_method.<br><br>Cheers,<br>Alex<br><br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 2:20 PM, Dave Doyle <span dir="ltr"><<a href="mailto:dave.s.doyle@gmail.com">dave.s.doyle@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">...<br><br>Dammit.<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">
On Fri, Oct 3, 2008 at 1:39 PM, Richard Dice <span dir="ltr"><<a href="mailto:rdice@pobox.com" target="_blank">rdice@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"> <div class="gmail_quote"><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">But then Richard broke my head with:<br>
<br>sub a {<br> &b<br>}<br></div></blockquote></div><div><br>Jon Orwant schooled me with this one back in '97.<br> </div><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">My jaw literally hit the table. I'd also not know the & invocation style (without brackets) automatically passed @_ into the sub. I'd thought that & is soooo Perl 4 and beneath my notice. Whoops. Two characters. Two bloody characters to my 21.<br>
</div></blockquote></div><div><br>Of course, '&' is necessary when defererencing a coderef, but the context is different I'll admit.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Got the job though. :)<br><font color="#888888"></font></div></blockquote><div><br>Yeah, about that. We should talk...<br><br>Cheers,<br> - Richard<br><br></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><div class="Ih2E3d">-- <br><a href="mailto:dave.s.doyle@gmail.com" target="_blank">dave.s.doyle@gmail.com</a><br>
</div></div>
<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" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Alexandru Capsa<br>
</div>