<doh!><br><br>Yes. Perl reads the entire file before executing anything. Bash must have functions before they are called (and Fortran, but who use that?)<br><br><div class="gmail_quote">On Fri, Jan 18, 2013 at 11:00 AM, Brandon Wood <span dir="ltr"><<a href="mailto:woody@2143.net" target="_blank">woody@2143.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fair enough; apologies for the suggestion of trolling.<br><br>And no, it doesn't matter where you place the sub, at the start, in the middle, at the end. The parser reads the whole script through first and handles things from there.<div class="HOEnZb">
<div class="h5"><br>
<br><br><div class="gmail_quote">On Fri, Jan 18, 2013 at 3:43 PM, Charles Shapiro <span dir="ltr"><<a href="mailto:hooterpincher@gmail.com" target="_blank">hooterpincher@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Of course, it might have to do with geezer-coders (like me) who learned C first. You have to define a subroutine before you can use it in C. You can either write an explicit function prototype (e.g. "int my_dog_sex(char *,int);" ) before calling your function, or you can define the whole function before calling it. This makes it more convenient to put your functions above your main() call, as then you didn't have to type in or maintain prototype lines in addition to the functions themselves.<br>
<br></div>-- CHS<br><br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 18, 2013 at 10:25 AM, Geoffrey Myers <span dir="ltr"><<a href="mailto:lists@serioustechnology.com" target="_blank">lists@serioustechnology.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I don't think it is required. See my last post. <div><br><br><div>--</div><div>From my iP<span>hone</span></div>
<div>Geoffrey Myers</div></div></div><div><div><div><br>On Jan 18, 2013, at 10:21 AM, Jim Kinney <<a href="mailto:jim.kinney@gmail.com" target="_blank">jim.kinney@gmail.com</a>> wrote:<br><br></div><blockquote type="cite">
<div>It's required. Not just a "style thing".<br><br>Alternatively, put subroutines in external files and call them in from the top of the script. My Perl is getting quite rusty but I think it's <br><br>
require:<file> ;<br>
<br><div class="gmail_quote">On Fri, Jan 18, 2013 at 10:12 AM, Geoffrey Myers <span dir="ltr"><<a href="mailto:lists@serioustechnology.com" target="_blank">lists@serioustechnology.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>Not trolling. I didn't want to taint the discussion by specifying my particular style. It does appear to me that most perl code I encounter has subroutines before the main code. <div><br>
<br><div>--</div><div>From my iP<span>hone</span></div><div>Geoffrey Myers</div></div></div><div><div><div><br>On Jan 18, 2013, at 10:00 AM, Brandon Wood <<a href="mailto:woody@2143.net" target="_blank">woody@2143.net</a>> wrote:<br>
<br></div><blockquote type="cite"><div><div> Not sure if you're trolling or looking to have a more specific discussion as "most perl coders" is a bit of a broad statement. There are a LOT of Perl coders, many with different styles. So far as the language itself is concerned you can do it different ways; though there are suggested good practices.</div>
<div><br></div><div> And yes, Perl is still alive and well and in a period of renaissance these last few years. There is an active Perl Mongers group in Atlanta that meets the first Thursday of the month. All are welcome, see <a href="http://atlanta.pm.org" target="_blank">http://atlanta.pm.org</a> for more information.</div>
<div><br></div><div>--</div><div>Woody<br><br><div class="gmail_quote">On Fri, Jan 18, 2013 at 9:46 AM, Sam Rakowski <span dir="ltr"><<a href="mailto:devnull@iamdevnull.info" target="_blank">devnull@iamdevnull.info</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Perl is eternal.<br>
Sent via BlackBerry<br>
<div><div>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Ale mailing list</span><br><span><a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a></span><br>
<span><a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a></span><br><span>See JOBS, ANNOUNCE and SCHOOLS lists at</span><br><span><a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a></span><br>
</div></blockquote></div></div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><i><i><i><i><br></i></i></i>Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.<br>
- Speech 11/23/1900 Mark Twain<br><i><i><i><i><br><a href="http://electjimkinney.org" target="_blank">http://electjimkinney.org</a><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
</i></i></i>
</i></i></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Ale mailing list</span><br><span><a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a></span><br>
<span><a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a></span><br><span>See JOBS, ANNOUNCE and SCHOOLS lists at</span><br><span><a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a></span><br>
</div></blockquote></div></div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><i><i><i><i><br></i></i></i></i>Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.<br>
- Speech 11/23/1900 Mark Twain<br><i><i><i><i><br><a href="http://electjimkinney.org" target="_blank">http://electjimkinney.org</a><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
</i></i></i></i>