
FishMonger
Veteran
Jul 9, 2012, 8:20 AM
Post #4 of 5
(1277 views)
|
|
Re: [lukdk] Very N00B question - Predeclaring SUBs ?
[In reply to]
|
Can't Post
|
|
I always call my subs using something like &SayHello("HELLO WORLD"); snip
sub SayHello () { Please don't do it that way unless you understand what the side affect is and need that side affect. It's best practice to not use & when calling a sub, just use the parens. Prototype definitions, especially empty ones, are almost never needed or wanted.
sub SayHello () { my $parameter=$_; That's not doing what you think. The assignment should have been written as: or
|