On 19 Jan 2003 23:11:22 +0000, Mikhael Goikhman wrote:
>
> On 19 Jan 2003 15:59:18 -0500, parv wrote:
> >
> > > > as a side note, why are you calling the non referenced named subs
> > > > via "&", e.g. "&showTab($tId, $tabNo);"? won't the named subs
> > > > will just work w/o "&", am i missing something?
> > >
> > > Both are valid Perl syntax. The '&' just means the subroutine
> > > doesn't have to be declared before it is used. I probably don't
> > > need it, but using '&' everywhere means I don't even have to worry
> > > about whether I should use it or not.
> >
> > unless you are using non-parenthesis version of subs, it really does
> > not matter where you declare/define subs.
>
> No, this is incorrect. Starting with perl-5.6.0, if you define a function
> with parameters (and for the fvwm's perllib such definition is a rule),
> the function should be declared before its first usage, otherwise you get
> a warning.
This is quite an off topic, but I forgot to add. I didn't mean '&' should
be used everywhere, I would prefer a predeclaration. There is though one
case when I prefer the '&' syntax - recursive functions.
Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sun Jan 19 2003 - 17:23:24 GMT